Silverlight: DataGrid with integrated field (column) chooser
October 11, 2010 13 Comments
Not much to say here, it speaks for itself.
Right click on a column header to open the field (columns) chooser and show/hide columns.
The VisibleColumns property is always up-to-date and can be binded TwoWay, in my case I am saving it to the user preferences for consistency.
Take a look at the code to see how it’s done.
Notice: ContextMenu causes memory leak! http://silverlight.codeplex.com/workitem/7089. as long as you don’t need to remove the DataGrid you are OK.
the WPF version is over here

