Reputation: 17677
Is there a way to have ungrouped and grouped items mixed in the same datagrid? For example, think of a grid that lists the root items on a C:\ drive.
Obviously, we would want the Directory Structure to be group and expandable. But the files on the root drive would also be shown on the list, however they would not be grouped.
Is there an idea way to handle this situation? Does anyone have any examples available?
Upvotes: 1
Views: 1058
Reputation: 392
your dataProvider(say an ArrayCollection) which you will typecast to HierarchicalData should be a collection of objects of the following structure.
{column1Data:"",column2Data:"",column3Data:""...columnNData:"",categories:arr} where arr is another ArrayCollection of the same structure ie {column1Data:"",...columnNData:"",categories:arr1} and arr1 again of the same structure.this can go on till arrN ,if you have N level drilldown.
Those objects which represent only one level of data(or ungrouped data as you say) will not have the "categories" attribute.
Upvotes: 0
Reputation: 8050
Using the AdvancedDataGrid with HierarchicalData
(another link) should get you the functionality you're looking for.
Upvotes: 1