Monday, June 22, 2015

Find Gridview Row From List and check it.

foreach (var item in listPeople)
{
 var row = gvAddPeople.Rows.Cast<GridViewRow>()
.Where(x => ((HiddenField)x.Cells[0].Controls[3]).Value == item.PeopleID.ToString()).Single();

 ((CheckBox)row.Cells[0].Controls[1]).Checked = true;
}

No comments:

Post a Comment