Question

Is it possible to allow a datagrid column to be dragged vertically and dropped into an area above the datagrid which triggers it to group by that column? If so, how would i best implement this into a silverlight 3 application?

Heres an example of what it could look like:
http://www.syncfusion.com/content/en-US/products/feature/windows-forms/grid/img/windows-forms-grid-dragcolumnintogrouparea.png

Was it helpful?

Solution

Interestingly, the Silverlight 3 DataGrid supports grouping internally (at an API level) but doesn't provide a UI to actually activate the grouping. Dragging the column up above the normal headers is, as you say, an obvious way to do that, but it's just not implemented in the Silverlight 3 stock DataGrid.

Various other third party vendors (e.g. http://www.telerik.com/products/silverlight/gridview.aspx and http://www.componentone.com/SuperProducts/GridSilverlight/ and others...) do have nice Silverlight grids that provide this feature out of the box, as well as filtering, subgrids and all sorts of other bells & whistles. However, these are not free (but may be cheaper than implementing it yourself), and the company I work for evaluated many of these in June 2009 and found that the live scrolling performance was a bit poor compared to the (virtualising) built-in Silverlight DataGrid for large datasets. Of course, things may now have changed, or you may care more about being able to group than scroll quickly. Hope that helps?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top