Wednesday, December 21, 2011

Finding Control in Gridview rows


if you want to find perticular Control inside the GrideView  for below sample Example explains  :-

Whether CheckBox in 5Th row of the gridview is checked or not


foreach(GridViewRow gvRow in gdv.Rows)
{
CheckBox chk = (CheckBox)gdv.Rows[gvRow.RowIndex].FindControl("chkItem"); 

if(chk.Checked)
{
// write your own logic....

}
}

No comments: