This question is locked. New answers and comments are not allowed.
Hi,
I am trying to manipulate the way the user interacts with the RadGridView control.
So, on initialization i add the following event to the grid.
| this.grid.GroupDescriptions.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(GroupDescriptions_CollectionChanged); |
where GroupDescriptions_CollectionChanged is:
| private void GroupDescriptions_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) | |
| { | |
| RadGroupDescription group = null; | |
| if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add) | |
| { | |
| group = e.NewItems[0] as RadGroupDescription; | |
| grid.Columns[group.PropertyName].IsVisible = false; | |
| } | |
| else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove) | |
| { | |
| group = e.OldItems[0] as RadGroupDescription; | |
| grid.Columns[group.PropertyName].IsVisible = true; | |
| } | |
| } |
So, when someone, adds a column to the group panel, i hide that column and vise versa.
Say that i have two columns predefined on my grid as Grouped. I bind my data from a WCF service and everything works fine. When i remove a column, everything still works ok and the column now appears on the column headers since its removed froum the group panel. When i try to add it again, and from that point onwards, the e.Action property (for that column) will always have a value of Reset, so i don't know (in my code) if a column is being added or removed.
Does Reset means something?? Is there any workarounds on this?!?
Many thanks,
Antonis
