This is a migrated thread and some comments may be shown as answers.

External grouping and filtering

6 Answers 64 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Murray
Top achievements
Rank 2
Murray asked on 29 Aug 2011, 09:33 PM
Here is my scenario

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

Sort by
0
Vlad
Telerik team
answered on 30 Aug 2011, 06:55 AM
Hello Murray,

 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 >>

0
Murray
Top achievements
Rank 2
answered on 30 Aug 2011, 11:46 AM
Thanks Vlad.

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
0
Murray
Top achievements
Rank 2
answered on 30 Aug 2011, 12:12 PM
Actually I think I figured out grouping?

Could you give an example of how to list the available columns and then show the available filter options based on the column selected?
0
Pavel Pavlov
Telerik team
answered on 02 Sep 2011, 11:26 AM
Hello Murray,

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 >>

0
Murray
Top achievements
Rank 2
answered on 02 Sep 2011, 12:02 PM
Hi Pavel

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
0
Maya
Telerik team
answered on 07 Sep 2011, 04:44 PM
Hello 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 >>

Tags
GridView
Asked by
Murray
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Murray
Top achievements
Rank 2
Pavel Pavlov
Telerik team
Maya
Telerik team
Share this question
or