private void FillDELSGrid() { try { DominoEventLog nameObj = new DominoEventLog(); nameObj.Name = EventNameTextBox.Text; DELSDataTable = new DataTable(); DELSDataTable = VSWebBL.ConfiguratorBL.DELSBL.Ins.GetDELSData(nameObj); //if (DELSDataTable.Rows.Count > 0) //{ // DELSDataTable.PrimaryKey = new DataColumn[] { DELSDataTable.Columns["ID"] }; //} DataTable dtcopy = DELSDataTable.Copy(); dtcopy.PrimaryKey = new DataColumn[] { dtcopy.Columns["ID"] }; Session["DELStable"] = dtcopy; DELSGridView.Selection.IsRowSelected(1); DELSGridView.DataSource = DELSDataTable; DELSGridView.DataBind(); //if (EventKey != 0) //{ // DataTable ELSDataTable1 = new DataTable(); // ELSDataTable1 = VSWebBL.ConfiguratorBL.ELSBL.Ins.GetSelectedEventsForKey(EventKey); // foreach (DataRow r in ELSDataTable1.Rows) // { // int startIndex = DELSGridView.PageIndex * DELSGridView.SettingsPager.PageSize; // int endIndex = Math.Min(DELSGridView.VisibleRowCount, startIndex + DELSGridView.SettingsPager.PageSize); // for (int i = startIndex; i < endIndex; i++) // { // DataRow row = DELSGridView.GetDataRow(i); // if (Convert.ToInt32(row[1]) == Convert.ToInt32(r[0])) // DELSGridView.Selection.SelectRow(i); // } // } //} } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); throw ex; } finally { } }
private void FillDELSGridfromSession() { try { DELSDataTable = new DataTable(); if (Session["DELStable"] != "" && Session["DELStable"] != null) { DELSDataTable = (DataTable)Session["DELStable"]; } if (DELSDataTable.Rows.Count > 0) { DELSDataTable.PrimaryKey = new DataColumn[] { DELSDataTable.Columns["ID"] }; } DELSGridView.DataSource = DELSDataTable; DELSGridView.DataBind(); } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); throw ex; } finally { } }