protected void TreeView1_TreeNodeExpanded(object sender, TreeNodeEventArgs e) { Response.Write(e.Node.Text + "-" + e.Node.Value); DataSet dsAllYearEventIDs = obj.GetCompanyID(e.Node.Text); DataTable dt1 = dsAllYearEventIDs.Tables[0]; TreeNode year = (TreeNode)TreeView1.FindNode("year"); year = new TreeNode(); year.PopulateOnDemand = true; TreeNode yearchild = new TreeNode(); yearchild.PopulateOnDemand = true; yearchild.SelectAction = TreeNodeSelectAction.None; yearchild.Text = "<u style='text-style:italic;'>" + "Clinical Events with current guidance of year " + e.Node.Text + "</u>"; year.ChildNodes.Add(yearchild); StringBuilder sbyear = new StringBuilder(); sbyear.AppendLine("<table style='border:1px solid gray;' width='100%'>"); for (int j = 0; j < dt1.Rows.Count; j++) { DataSet dsAllDescription = obj.GetTickerEventDescription(dt1.Rows[j]["Company_ID"].ToString()); DataTable dt2 = new DataTable(); dt2 = dsAllDescription.Tables[0]; sbyear.AppendLine("<tr>"); sbyear.AppendLine("<td style='width:120px; border:0px dotted gray;'>"); sbyear.AppendLine("<a href='" + "Ticker.aspx?tick=" + dt2.Rows[0][0].ToString() + "'><b>" + dt2.Rows[0][0].ToString() + "</b></a>"); sbyear.AppendLine("</td>"); sbyear.AppendLine("<td style='width:120px; border:0px dotted gray;'>"); sbyear.AppendLine(dt2.Rows[0][1].ToString()); sbyear.AppendLine("</td>"); sbyear.AppendLine("<td style='width:180px; border:0px dotted gray;'>"); sbyear.AppendLine(dt2.Rows[0][2].ToString()); sbyear.AppendLine("</td>"); sbyear.AppendLine("</tr>"); } sbyear.AppendLine("</table>"); TreeNode childnode = new TreeNode(); childnode.PopulateOnDemand = true; childnode.SelectAction = TreeNodeSelectAction.None; childnode.Text = sbyear.ToString(); year.ChildNodes.Add(childnode); }
protected void TreeView1_TreeNodePopulate(object sender, TreeNodeEventArgs e) { DataSet dsAllYearEventIDs = obj.GetCompanyID(e.Node.Text); DataTable dt1 = dsAllYearEventIDs.Tables[0]; TreeNode year = (TreeNode)TreeView1.FindNode("year"); year = new TreeNode(); year.PopulateOnDemand = false; TreeNode yearchild = new TreeNode(); yearchild.PopulateOnDemand = false; yearchild.SelectAction = TreeNodeSelectAction.None; yearchild.Text = "<u style='text-style:italic;'>" + "Clinical Events with current guidance of year " + e.Node.Text + "</u>"; year.ChildNodes.Add(yearchild); StringBuilder sbyear = new StringBuilder(); sbyear.AppendLine("<table style='border:1px solid gray;' width='100%'>"); for (int j = 0; j < dt1.Rows.Count; j++) { DataSet dsAllDescription = obj.GetTickerEventDescription(dt1.Rows[j]["Company_ID"].ToString()); DataTable dt2 = new DataTable(); dt2 = dsAllDescription.Tables[0]; sbyear.AppendLine("<tr>"); sbyear.AppendLine("<td style='width:120px; border:0px dotted gray;'>"); sbyear.AppendLine("<a href='" + "Ticker.aspx?tick=" + dt2.Rows[0][0].ToString() + "'><b>" + dt2.Rows[0][0].ToString() + "</b></a>"); sbyear.AppendLine("</td>"); sbyear.AppendLine("<td style='width:120px; border:0px dotted gray;'>"); sbyear.AppendLine(dt2.Rows[0][1].ToString()); sbyear.AppendLine("</td>"); sbyear.AppendLine("<td style='width:180px; border:0px dotted gray;'>"); sbyear.AppendLine(dt2.Rows[0][2].ToString()); sbyear.AppendLine("</td>"); sbyear.AppendLine("</tr>"); } sbyear.AppendLine("</table>"); TreeNode childnode = new TreeNode(); childnode.PopulateOnDemand = false; childnode.SelectAction = TreeNodeSelectAction.None; childnode.Text = sbyear.ToString(); year.ChildNodes.Add(childnode); }
EventManager obj = new EventManager(); DataSet ds = new DataSet(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { TreeView1.CollapseAll(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)