Hello,
I'm seeing a difference in behavior and I was hoping someone could help me out. If I drag a column into the group area and then drag it out, the column re-appears in its original location.
If I instead programatically group that same column doing this:
Grid.DisplayLayout.Bands[0].Columns[itemColumnKey].Hidden = itemHiddenValue;Grid.DisplayLayout.Bands[0].Columns[itemColumnKey].Header.VisiblePosition = itemPosition;
Grid.DisplayLayout.Bands[0].SortedColumns.Add(itemColumnKey, true, true);
and then drag it out of the group area, the column disappears completely.
I would like the column to re-appear in its previous location the same as if it were grouped via drag-drop. Any help would be appreciated.
... phew! :)
Ah. It was the Hidden property that was causing the problem. Thank for your help. This was driving me nuts!
Try the sample I attached. Still seeing this behavior? I was using 2009 Vol 2 and I was not seeing this behavior. I grouped via code and ungrouped via code. I grouped via code and ungrouped via UI. Are you still using those other lines of code? Setting the Hidden property and the other one?
Hi Matthew,
The problem is, when I group via code:
Grid.DisplayLayout.Bands[0].SortedColumns.Add(myColKey, true, true);
and use the UI to ungroup, the column does not go back to where it started. It just disappears. Grouping/ungrouping via UI works fine.
Hi,
The column will be hidden automatically unless you are overriding this behavior... So all you need to do is
Grid.DisplayLayout.Bands[0].SortedColumns.Add(myColKey, true, true); to put it into GroupBy. When you ungroup (through UI or with code by clearing the sorted columns collection or setting the flag to false for group by on that one) it will go back where it started.
Attached is the sample I was using while playing with each scenario... drag/drop group by... dynamic ungroup and so on...