I do not have access to third party components on this project. I think I only have access to the built-in DataGrid and GridView controls.
Is there a good example for representing hierarchical data (inside a grid - Master /Details) in a built-in ASP.NET server control?
I am looking for an expand/collapse tree structure kind of implementation.
You're after the TreeView Server Control.
This is built into ASP.NET (System.Web.UI.WebControls).
Code sample from the Microsoft Reference (for static content):
<asp:TreeView ID="MyTreeView" Runat="server">
<Nodes>
<asp:TreeNode Value="Child1" Expanded="True" Text="1">
<asp:TreeNode Value="Grandchild1" Text="A" />
<asp:TreeNode Value="Grandchild2" Text="B" />
</asp:TreeNode>
<asp:TreeNode Value="Child2" Text="2" />
<asp:TreeNode Value="Child3" Expanded="True" Text="3">
<asp:TreeNode Value="Grandchild1" Text="A" />
</asp:TreeNode>
</Nodes>
</asp:TreeView>
You can also build a Treeview Dynamically.
There are good samples at MSDN for this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With