public void FillByTemplateGrid() { DataTable dt = VSWebBL.DashboardBL.mailFileBL.Ins.FillDBByTemplateGrid(); dt.PrimaryKey = new DataColumn[] { dt.Columns["ID"] }; ByTemplateGridView.DataSource = dt; ByTemplateGridView.DataBind(); ((GridViewDataColumn)ByTemplateGridView.Columns["DesignTemplateName"]).GroupBy(); Session["DBsByTemplate"] = dt; }
protected void btnCollapse_Click(object sender, EventArgs e) { if (btnCollapse.Text == "Collapse All Rows") { ByTemplateGridView.CollapseAll(); btnCollapse.Image.Url = "~/images/icons/add.png"; btnCollapse.Text = "Expand All Rows"; } else { ByTemplateGridView.ExpandAll(); btnCollapse.Image.Url = "~/images/icons/forbidden.png"; btnCollapse.Text = "Collapse All Rows"; } }
private void FillByTemplateGridFromSession() { try { DataTable dt = new DataTable(); if (Session["DBsByTemplate"] != "" && Session["DBsByTemplate"] != null) { dt = (DataTable)Session["DBsByTemplate"]; } if (dt.Rows.Count > 0) { ByTemplateGridView.DataSource = dt; ByTemplateGridView.DataBind(); } } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); throw ex; } finally { } }