This tutorial shows how to create a new TableNode in response to a click on a node in the organizational chart described in the previous topic. The table displays additional information about the employee corresponding to the clicked shape node.
Visual Studio generates the DiagramView1_NodeClicked method for handling the NodeClicked event.
Switch to the Default.aspx.cs file. The DiagramView1_NodeClicked method should contain the necessary code for displaying information about the personnel in the clicked node.
C# Copy Code |
---|
protected void DiagramView1_NodeClicked(object sender, NodeEventArgs e) } |
C# Copy Code |
---|
protected void DiagramView1_NodeClicked(object sender, NodeEventArgs e) |
Well, this displays the same table regardless which employee is clicked, but let's pretend the data is queried from a database depending on the Tag of the clicked node.
Select the NetDiagram control. In the Properties window, select the following Diagram properties: set TableShape to RoundedRectangle, set TableRowCount to 3, TableColumnCount to 2, choose TableBrush, TableColumnWidth, TableRowHeight as desired.
After drawing the diagram, click on a diagram node. A table node is created containing information about the clicked node: