protected override void OnEnter(EventArgs e) { if (DynamicRadioButton.Checked) { DynamicRadioButton.Select(); } else { ServersGridView.Select(); } }
// we dont need to bother firing events if the other radio button gets checked or unchecked private void StaticRadioButton_CheckedChanged(object sender, EventArgs e) { if (StaticRadioButton.Checked && SelectedServer() == null) { SelectSomething(); } UpdateControl(); if (StaticRadioButton.Checked) { ServersGridView.Select(); } }
private void FillServersGridfromSession() { try { ServersDataTable = new DataTable(); if (Session["Servers"] != null && Session["Servers"] != "") { ServersDataTable = (DataTable)Session["Servers"];//VSWebBL.ConfiguratorBL.DominoPropertiesBL.Ins.GetAllData(); } if (ServersDataTable.Rows.Count > 0) { ServersGridView.DataSource = ServersDataTable; ServersGridView.DataBind(); } } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); throw ex; } finally { } }
private void FillServersGrid() { try { ServersDataTable = new DataTable(); DataSet ServersDataSet = new DataSet(); ServersDataTable = VSWebBL.SecurityBL.ServersBL.Ins.GetAllData(Convert.ToInt32(Session["UserID"])); if (ServersDataTable.Rows.Count > 0) { //DataTable dtcopy = ServersDataTable.Copy(); //dtcopy.PrimaryKey = new DataColumn[] { dtcopy.Columns["ID"] }; ServersDataTable.PrimaryKey = new DataColumn[] { ServersDataTable.Columns["ID"] }; } Session["Servers"] = ServersDataTable; ServersGridView.DataSource = ServersDataTable; ServersGridView.DataBind(); } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); throw ex; } finally { } }
public void fillServersTreeList() { try { if (Session["DataServers"] == null) { DataTable DataServersTree = VSWebBL.SecurityBL.ServersBL.Ins.GetAllDataByServerType(ServerTypeComboBox.SelectedItem.Text); Session["DataServers"] = DataServersTree; } ServersGridView.DataSource = (DataTable)Session["DataServers"]; ServersGridView.DataBind(); //DataTable dtSel = VSWebBL.ConfiguratorBL.AlertsBL.Ins.GetSelectedServers(AlertKey); //if (dtSel.Rows.Count > 0) //{ // TreeListNodeIterator iterator = ServersTreeList.CreateNodeIterator(); // TreeListNode node; // for (int i = 0; i < dtSel.Rows.Count; i++) // { // if (Convert.ToInt32(dtSel.Rows[i]["ServerID"]) == 0 && Convert.ToInt32(dtSel.Rows[i]["UserProfileID"]) == 0) // { // //select all // while (true) // { // node = iterator.GetNext(); // if (node == null) break; // node.Selected = true; // } // } // else if (Convert.ToInt32(dtSel.Rows[i]["ServerID"]) == 0 && (Convert.ToInt32(dtSel.Rows[i]["UserProfileID"]) != 0)) // { // //parent selected // while (true) // { // node = iterator.GetNext(); // if (node == null) break; // if ((Convert.ToInt32(dtSel.Rows[i]["UserProfileID"]) == Convert.ToInt32(node.GetValue("actid"))) && node.GetValue("tbl").ToString() == "UserProfiles") // { // node.Selected = true; // } // else if (node.GetValue("LocId").ToString() != "") // { // if ((Convert.ToInt32(dtSel.Rows[i]["UserProfileID"]) == Convert.ToInt32(node.GetValue("LocId"))) && node.GetValue("tbl").ToString() != "UserProfiles") // { // node.Selected = true; // } // } // } // } // else if (Convert.ToInt32(dtSel.Rows[i]["ServerID"]) != 0 && (Convert.ToInt32(dtSel.Rows[i]["UserProfileID"]) != 0)) // { // //specific selected // while (true) // { // node = iterator.GetNext(); // if (node == null) break; // if ((Convert.ToInt32(dtSel.Rows[i]["ServerID"]) == Convert.ToInt32(node.GetValue("actid"))) && node.GetValue("tbl").ToString() != "UserProfiles") // { // node.Selected = true; // } // } // } // iterator.Reset(); // } //} } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); throw ex; } }