Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I am not sure if you would be interested to use a third party control, but I had EXACTLY SAME requirement of yours and needed to display the data hierarchically, showing repeating values as single one with collapsible nodes (like trees). However, Tree controls are not data bound and still needs a fair bit of coding. But this style of Tree building based on non-normalized data can be easily done with DataBinding. The FlexGrid I have used was DataBound to the DataTable and just needed a few lines of code to display EXACTLY what you require, albeit based on a Third Party Control.</p> <p>I have used the ComponentOne FlexGrid control and used its 'SubTotal' feature to generate the hierarchical data. I am pasting the code below, just in case you are interested to use the ComponentOne FlexGrid. You can download a Demo copy and check.</p> <pre><code> // Showing master policy in GROUPS // ----------------------------------------------------------------------------------- // set tree mode to show settings in GROUPS flxAvailableSettings.Tree.Style = TreeStyleFlags.Simple; // show outline tree on column 1. flxAvailableSettings.Tree.Column = 0; flxAvailableSettings.Cols[0].Visible = true; flxAvailableSettings.Cols[0].Width = 15; flxAvailableSettings.AllowMerging = AllowMergingEnum.Nodes; // subtotal on column 1, outline level 0 flxAvailableSettings.Subtotal(AggregateEnum.None, 0, 0, 0, "{0}"); // use owner draw to suppress repeating group names in Non-Node rows flxAvailableSettings.DrawMode = DrawModeEnum.OwnerDraw; flxAvailableSettings.OwnerDrawCell += new C1.Win.C1FlexGrid.OwnerDrawCellEventHandler(flxAvailableSettings_OwnerDrawCell); // done, autosize columns to finish flxAvailableSettings.AutoSizeCols(); // ----------------------------------------------------------------------------------- private void flxAvailableSettings_OwnerDrawCell(object sender, C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e) { if (!flxAvailableSettings.Rows[e.Row].IsNode &amp;&amp; flxAvailableSettings.Cols[e.Col].Name == "PolicyGroup") e.Text = ""; } </code></pre> <p>The flxAvailableSettings.Subtotal(AggregateEnum.None, 0, 0, 0, "{0}") line generates the Tree Groups, though I needed to group on a single column, you can use groups on multiple columns. Just refer their docs example on Subtotalling.</p> <p>Hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload