public void BindTrainingItems() { int is_Fetch_Count = ucCustomPagerAllStatus.isCountRecord; DataTable dt = BLL_LMS_Training.Get_ChapterDetails_List(null, UDFLib.ConvertStringToNull(txtSearchItemName.Text.Trim()), UDFLib.ConvertStringToNull(ddlItemType.SelectedIndex == 0 ? null : ddlItemType.SelectedItem.Text), ucCustomPagerAllStatus.CurrentPageIndex, ucCustomPagerAllStatus.PageSize, ref is_Fetch_Count).Tables[0]; gvTrainingItems.DataSource = dt; gvTrainingItems.DataBind(); ucCustomPagerAllStatus.CountTotalRec = is_Fetch_Count.ToString(); ucCustomPagerAllStatus.BuildPager(); }
protected void BindChapterItem() { SaveSelectedChapterItems(); int is_Fetch_Count = ucCustomPagerChapterDetails.isCountRecord; DataSet ds = BLL_LMS_Training.Get_ChapterDetails_List(UDFLib.ConvertIntegerToNull(ViewState["Chapter_Id"]), UDFLib.ConvertStringToNull(txtSearchItemName.Text), UDFLib.ConvertStringToNull(ddlItemType.SelectedIndex == 0 ? null : ddlItemType.SelectedItem.Text), ucCustomPagerChapterDetails.CurrentPageIndex, ucCustomPagerChapterDetails.PageSize, ref is_Fetch_Count); gvItemList.DataSource = ds; gvItemList.DataBind(); ucCustomPagerChapterDetails.CountTotalRec = is_Fetch_Count.ToString(); ucCustomPagerChapterDetails.BuildPager(); DataTable dtChapterItemList = ViewState["dtChapterItemList"] as DataTable; foreach (GridViewRow gr in gvItemList.Rows) { int Item_ID = Convert.ToInt32(gvItemList.DataKeys[gr.RowIndex].Value); if (dtChapterItemList.Rows.Contains(Item_ID)) { (gr.FindControl("chkSelected") as CheckBox).Checked = true; } } }