Pages

Saturday, November 27, 2010

With BoundColumns


------------------------------------------------------------




//WITH BOUND COLUMNS
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
// ValidateRequest="false" in the page directive
// GridViewRow selectedRow = (GridViewRow)((ImageButton)e.CommandSource).NamingContainer;

if (e.CommandName.ToLower().Equals("select"))
{
GridViewRow grow = (GridViewRow)((Button)e.CommandSource).NamingContainer;

int index = Convert.ToInt32(grow.RowIndex);

DropDownList myddl = (DropDownList)(grow.FindControl("ddlCountry"));

TextBox1.Text = grow.Cells[1].Text;
TextBox2.Text = grow.Cells[2].Text;
TextBox3.Text = grow.Cells[3].Text;
TextBox4.Text = grow.Cells[4].Text;
TextBox5.Text = myddl.SelectedItem.Text;
}
}






0 comments:

Post a Comment

 

CodeAddict.com | Copyright 2009 Tüm Haklar? Sakl?d?r | Free Blogger Templates by GoogleBoy Download Free Wordpress Templates. Unblock through unblock myspace proxy, Hillsongs by Guitar Song Chords