View Single Post
  #70 (permalink)  
Old 08-28-2007, 04:36 AM
Venkat Venkat is offline
D-Web Master
 
Join Date: Mar 2007
Posts: 350
Venkat is on a distinguished road
Thumbs up Re: ASP.NET Data Controls

hey H2o,

Since we don't know the name of the control, you simply pull the control out of the specific cell's control collection. For example, if your CheckBoxField was the first column of your GridView, then you'd retrieve the CheckBox reference like so:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
GridViewRow gvr = e.Row;

if (gvr.RowType == DataControlRowType.DataRow)
{
CheckBox chk = gvr.Cells[0].Controls[0] as CheckBox;
}
}
__________________
Venkat
knowledge is Power
Reply With Quote