public void FillServersListGridfromSession() { DataTable DataServers = new DataTable(); try { if (Session["ExchangeServerList"] != null && Session["ExchangeServerList"] != "") { DataServers = Session["ExchangeServerList"] as DataTable; } if (DataServers.Rows.Count > 0) { DataServers.PrimaryKey = new DataColumn[] { DataServers.Columns["ID"] }; //ServerList.Text = DataServers.Rows.Count.ToString(); } EXGHealthGridView.DataSource = DataServers; EXGHealthGridView.DataBind(); } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); throw ex; } }
protected void EXGHealthGridView_SelectionChanged(object sender, EventArgs e) { if (EXGHealthGridView.Selection.Count > 0) { if (Session["UserFullName"] != null) { List <object> fieldValues = EXGHealthGridView.GetSelectedFieldValues(new string[] { "redirectto" }); //7/22/2014 NS commented the line below, uncommented the following line - the page would auto redirect on each refresh //Response.Redirect(fieldValues[0].ToString()); //Mukund: VSPLUS-844, Page redirect on callback try { DevExpress.Web.ASPxWebControl.RedirectOnCallback(fieldValues[0].ToString()); Context.ApplicationInstance.CompleteRequest();//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); //throw ex; } } } }
public void FillServersListGrid() { DataTable dt = new DataTable(); dt = VSWebBL.ExchangeBAL.Ins.GetExchangeServerDetails(); Session["ExchangeServerList"] = dt; //ServerList.Text = "0"; //10/15/2014 NS added for VE-133 DataRow osrow; DataRow[] foundRows; DataRow statusrow; osrow = oslist.NewRow(); statusrow = statuslist.NewRow(); if (dt != null && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { if (oslist.Rows.Count > 0) { foundRows = oslist.Select("OS = '" + dt.Rows[i]["OperatingSystem"].ToString() + "'"); if (foundRows.Length == 0) { osrow = oslist.Rows.Add(); osrow["OS"] = dt.Rows[i]["OperatingSystem"].ToString(); osrow["OSCount"] = 1; osrow = oslist.NewRow(); } else { osrow = foundRows[0]; osrow["OSCount"] = Convert.ToInt32(osrow["OSCount"].ToString()) + 1; } } else { osrow = oslist.Rows.Add(); osrow["OS"] = dt.Rows[i]["OperatingSystem"].ToString(); osrow["OSCount"] = 1; osrow = oslist.NewRow(); } if (statuslist.Rows.Count > 0) { foundRows = statuslist.Select("Status = '" + dt.Rows[i]["Status"].ToString() + "'"); if (foundRows.Length == 0) { statusrow = statuslist.Rows.Add(); statusrow["Status"] = dt.Rows[i]["Status"].ToString(); statusrow["StatusCount"] = 1; statusrow = statuslist.NewRow(); } else { statusrow = foundRows[0]; statusrow["StatusCount"] = Convert.ToInt32(statusrow["StatusCount"].ToString()) + 1; } } else { statusrow = statuslist.Rows.Add(); statusrow["Status"] = dt.Rows[i]["Status"].ToString(); statusrow["StatusCount"] = 1; statusrow = statuslist.NewRow(); } } } EXGHealthGridView.DataSource = dt; EXGHealthGridView.DataBind(); }