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

GridView Filtering and Grouping with an Actual Value, but Displaying another Value in the Filter Control and Group Header

4 Answers 131 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Yasser Makram
Top achievements
Rank 1
Yasser Makram asked on 06 Feb 2010, 09:41 PM
I have a requirement to have a grid column display a value from a group of values like (Good, Average, Bad), but the values are actually stored as integers (0, 1, 2). I don't have a problem in displaying or editing the values, you provide excellent support for that using either the celltemplates and or combo box grid column. The problem is when I do that, the Filter control displays the actual values (0, 1, 2) yet I need to display (Good, Average, Bad) instead. I have tried using the DistinctValuesLoading event to populate the Filter screen, and it successfully populated the Filter control, and using the Filtering event and checking for Member property and changing the Value property I can make the filtering operation to work.
The issue that whenever I do that and close the Filter popup and reopen it, nothing is selected. So is this the best way to achieve this behavior? I understand that you support custom filtering controls, but I was hoping to find a simpler solution to this basic problem and avoid recreating a complete custom filter with its UI.
The other part of the question is about the grouping and how to make the group header display (Good, Average, Bad) instead of (0, 1, 2). I have tried GroupHeaderFormatString and GroupMemberPath and I can't achieve what I need.
Thank you in advance for your support.

4 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 08 Feb 2010, 12:45 PM
Hello Yasser Makram,

You have two options here.

1. You can develop an IValueConverter that will receive the non-human-readable value, i.e. 1 and return the human-readable value, i.e. "Good". Then you should assign this converter in the DataMemberBinding of the respective column. The filtering UI will respect the converter and will show your user the human-readable values, while still filtering with the "real" values under the hood.

2. You second option is to develop your own custom filtering control. If you chose this approach you will have total control over what is going on in the filtering control. To learn how to do this, please follow my step-by-step tutorial Custom Filtering with RadGridView for Silverlight.

I hope this helps.

Best wishes,
Ross
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Moises Casusol
Top achievements
Rank 1
answered on 09 Apr 2010, 05:28 PM
Hi Ross,

(Solved: Was my fault bad assigment at DataBinding)
Thats right but that only works for FIltering. Im using an IValueConverter and for Grouping it doesnt show the Converted Value, for example: it shows "1" instead of "Good" in the GroupHeader. Im using RadGrid version 2010.1.309.1030.

(PENDING)
By the way, is there any performance issue? when i click the expand arrow It tooks like 3-4 secs to expand the group for only 20 rows, the datasource is ObservableCollection, no special columns (images,etc.), all text columns. Any tip to improved it?

Best Regards
-Moises
0
Rossen Hristov
Telerik team
answered on 10 Apr 2010, 07:35 AM
Hello Moises Casusol,

1. Grouping was intentionally left like that. You can use GroupHeaderTemplate property of the column to set desired content. Please check this demo for more info: http://demos.telerik.com/silverlight/#GridView/Totals

2. Please, send us your project. We need a runnable sample project that we can debug and see why is it so slow. You can open a support ticket and attach it there.

Meanwhile, could you please take a look at the Output windows of Visual Studio. Such slow downs are usually cause by numerous exceptions being thrown, for example by an incorrect Binding. Look at the Output while running the project and see whether something is crashing.

We are looking forward to hearing from you.

Kind regards,
Ross
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Moises Casusol
Top achievements
Rank 1
answered on 22 Apr 2010, 07:25 PM
Hi Ross,

Well, we did a little example of that part bacause our applicattion is too big, we discovered that in the example the performance was ok just like your demos because in the example it was only the RadGridView and the RadPager.

After hours of researching we try to put the RadGridView in a RadWindow at the Real applicattion and the performance was ok in that scenario. So we decide to show the results at the RadGriwView but in a RadWindow.

So we think it is a problem with the application structure with UserControls and RadFrameContainers amybe that affects the GridView performance. I attached an Image for the real aplication structure so you can do some tests with that.

thanks for all the help :D

best regards
-Moises
Tags
GridView
Asked by
Yasser Makram
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Moises Casusol
Top achievements
Rank 1
Share this question
or