에서 자식의 gridview를 찾을 방법이 호출하는 동안 선택된 체크 박스 값을 저장하려면 코드입니다,하지만 난 nested gridview
함께 일하고 같이 내가 필요한 아동의 gridview의 제어를 찾을 수 없습니다입니다사용자 정의 함수
private void SaveCheckedValues()
{
ArrayList userdetails = new ArrayList();
int index = -1;
GridView gv = (GridView)gvCustomers.FindControl("gvOrders"); // Is this correct or any other way of finding the child control
foreach (GridViewRow gvrow in gv.Rows)
{
index = (int)gv.DataKeys[gvrow.RowIndex].Value;
bool result = ((CheckBox)gvrow.FindControl("chkBoxChild")).Checked;
// Check in the Session
if (Session["CHECKED_ITEMS"] != null)
userdetails = (ArrayList)Session["CHECKED_ITEMS"];
if (result)
{
if (!userdetails.Contains(index))
userdetails.Add(index);
}
else
userdetails.Remove(index);
}
if (userdetails != null && userdetails.Count > 0)
Session["CHECKED_ITEMS"] = userdetails;
}