Child View

Aug 18, 2009 at 4:27 PM

Can we attach datagrid to the dataset and have child views? I would like to collapse and expand values on need.

Coordinator
Sep 3, 2009 at 8:58 AM

No, that is not possible

Jan 31, 2012 at 4:54 PM
Edited Feb 3, 2012 at 1:21 PM

Just because a feature isn't exposed doesn't mean the goal is not possible.

 

            dataGrid.DataSource = bd;
            grid[currentRow, 0].RowSpan = 6;
            grid[currentRow, 1].RowSpan = 6;
            grid.Columns[1].Width = 300;
            grid.LinkedControls.Add(new SourceGrid.LinkedControlValue(dataGrid, new SourceGrid.Position(currentRow, 1)));

 

This code needs work before it is truly useful, but clearly the child grid is showing up in the parent grid.

In other words, if your willing to use a Grid instead of a DataGrid for the parent, and handle the data-binding yourself (at least in the parent), you can achieve this effect.

I got this working in my "Object Grid", which is based on Grid.
Once I get the expand/collapse working, I will repost the code for that project in my post

How-To: Use SourceGrid.Grid As a PropertyGrid