I have a gridview with a lot of data columns. I am using a custom rowtemplate to stack the information so the user doesnt need to scroll (horizontally) too much.
The business however wants the ability to filter, sort and group all of the data, so I need to include every column header in the grid, which defeats the purpose of the custom template in stopping horizontal scroll.
I found this demo on how to externalize the sorting of data (http://demos.telerik.com/silverlight/#GridView/Sorting).
Is there a way to filter, sort and group data if I dont show the column headers in the grid? That way I can use my template and have an external panel which would house the functionality of group, sort and filter on available data fields.
See attached to explain what I am trying to achieve.
Thanks so much for your time,
Murray
6 Answers, 1 is accepted
You can use SortDescriptors, GroupDescriptors and FilterDescriptors collection of the grid to achieve your goal.
All the best,Vlad
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
I hate to ask this but I'm just a designer. Could you give me an example of grouping so I can figure out the rest when you have time?
Thanks so much
Murray
Could you give an example of how to list the available columns and then show the available filter options based on the column selected?
Can you please sketchup what are you trying to achieve as the last post does not make it much clear.
Where you need the columns listed , how do you ened the filter options displayed ?
Regards,
Pavel Pavlov
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
In my first post there is a mockup of what I want to achieve. The first section on the left is titled "Filter and Sort". In that, the first combo should be the titles of the columns, the second combo should be the available filters based on which field you have selected, and the third combo would be the sort order you want to apply to that selected field.
The submit button probably wouldnt be needed of the selections where realtime.
Thanks
Murray
You may get all the columns from the corresponding collection of the grid - Columns. Please take a look at this blog post for a reference. Thus you may easily set this collection as ItemsSource for the first combo. Afterwards, you need to handle the SelectionChanged event of this first combo box and depending on the selected column and the type of the underlying property to set the ItemsSource of the second combo with the appropriate filter operators. You may then create a ColumnFilterDescriptor (again on the SelectionChanged event). The source of the last combo should be a collection with the values - Ascending, Descending and None - you may actually define an enum for it. And again on its SelectionChanged event you may add a SortDescriptor to the SortDescriptors collection of the grid.
Greetings,
Maya
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>