protected override void OnRowDataBound(GridViewRowEventArgs e) { base.OnRowDataBound(e); if (e.Row.RowType != DataControlRowType.DataRow) { return; } if (!ShowCheckBox || dataSourceSelected == null) { return; } if (UData.Contains((DataTable)dataSourceSelected, DataKeyNames.GetValue(0).ToString(), UWeb.ToString(e, DataKeyNames.GetValue(0).ToString()))) { CheckBox chk = e.Row.FindControl("chk") as CheckBox; chk.Checked = true; } }