Our application saves grid and column properties as a view that can be applied to a WinGrid. If a view has a GroupBy column and applied to the grid (with the built in ColumnChooser), the grid is initially displayed with the group by column and the collapsed group by rows. If the group by column is then dragged on to the collapsed group by row, the first time and only the first time, that column remains hidden. It is still unchecked in the Column Chooser. After checking it to make it visible, any subsequent grouping and ungrouping works correctly as far as being hidden or not. If I expand the group by row before I do the first ungrouping it also works correctly. Am I missing some property initially that would cause the column dragged back to the grid to remain hidden the first time?
RM
Hi RM,
I'm sorry, but I'm afraid you lost me. You are dragging a GroupBy column onto a collapsed GroupByRow? That does not make sense to me.
I've attached a sample project. Just drag Column 2 over the collapsed row. The Group By goes away but Column 2 is still hidden, probably due to Hidden = true, But it only has this behavior the first time it is Un-grouped.
Okay, it looks like the HiddenWhenGroupBy property is what I need. Thanks for your help.
RM_mid said:I believe I noticed that when a column is a GroupBy column, it's Hidden value is also set to true.
I don't beleive that's true. Grouping a column should not change the Hidden property. There's a property on the column call HiddenWhenGroupBy which determines if the column is actually hidden when grouped. So there's no reason for your code to be setting the Hidden property here.
The HiddenResolved property will change, of course, since this indicates the actual state of the column, but this is just a read-only property.
Our application can optionally save column settings as an overall view to call up as needed. I believe I noticed that when a column is a GroupBy column, it's Hidden value is also set to true. So when a saved view is accessed to be applied to the grid, a GroupBy column's Hidden value is also true.
Okay, I see the issue. But if you want this column to be visible, why are you setting Hidden to true?
If there's a bug here, it might be that the column is not maintaining it's Hidden state the second time you ungroup it. But I'm not sure how they would happen, since there's no way for the user to re-group, since the column is hidden.