I have a dataset with two tables that have a data relation defined on the key field. I have two records in the first table with the same key field, and 3 records in the second table with the same key field.
In InitializeLayout for my grid, I set e.Layout.ViewStyleBand = Infragistics.Win.UltraWinGrid.ViewStyleBand.Horizontal. Viewing the grid gives me this:
I want to have the key fields for the first two records grouped together so that the user doesn't get confused about the number of records in the 2nd table, such as this:
How would I go about doing that?
Thanks,
Brad
Hi Brad,
There's no way to do this - at least not exactly the view you have here.
You could use OutlookGroupBy to group the parent records by key. But they will still display individually as two separate rows with the same (duplicate) set of child rows.
Another option might be to hide the child rows on all but the last parent row of the same key.
This would be pretty tricky, and would only work if the parent rows are sorted by key, but I think it should be possible. You would have to loop through the grid rows and find the last one of each particular key value. So in this case, you would determine that the first row should not show any child rows, but the second row will. Then you would mark the row somehow - maybe set the Tag property on the row to a boolean value or add an unbound column to the row and populate it with a bool.
Then in the InitializeRow, you trap for rows in the child band and set the Hidden property on the child row based on the parent's boolean value.