We're happily using the Telerik RadGridView with FilteringMode="FilterRow" which works great for regular GridViewDataColumn type columns. However, I can't get the filter row to give an option for filtering or sorting for columns of type GridViewComboBoxColumn. I did find this post, but that doesn't apply to FilteringMode="FilterRow" as far as I can tell.
Is there a way to make the FilteRow to behave the same way for GridViewComboBoxColumn type columns as it does for GridViewDataColumn type columns?
Thanks
Oskar.
7 Answers, 1 is accepted
As you already know, you can achieve this functionality using the Popup FilteringMode. Indeed, filtering control works with the data from the source of the grid. So, it can actually filters according to it. DistinctValues are only converted so that they visually look like the values from ComboboxColumn, but the filter does its magic on the values below those display values. However, I am afraid the this would not be possible with FilteringMode="FitlerRow".
Yoan
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>

thanks for your reply. Unfortunately the pop-up filter is "too intrusive" for what we have in mind. A simple "filter as you go" with a "contains" filter by default is what we need. Are you saying that there's no way to get the filter row to work for the GridViewComboBoxColumn?
Is there a way for me to raise this as an enhancement request?
Thanks
Oskar.
Actually, the field filter editor that is displayed in the header cell(the FilterRow) is exactly the same as either of the two field filter editors from the Popup filtering control. You can think of this as an oversimplified version of the Popup mode where the user sees only one of the two field filter editors of the Popup filtering control and the editor is always visible. In your case you can use a property called FilterMemberPath to the column class which allows you to bind to one property and filter by another property on the business object class.
Yoan
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>

Maybe I misunderstood what you were suggesting. I now tried this in a demo application:
<
telerik:GridViewComboBoxColumn
Header
=
"From Cardinality"
DataMemberBinding
=
"{Binding Path=From.Cardinality_}"
ItemsSourceBinding
=
"{Binding Items, Source={x:Static mg:Cardinalities.Instance}}"
FilterMemberPath
=
"From.Cardinality_"
/>
Here's a screenshot of this:
Please note that From.Cardinality_ is of type "class Cardinality" (one of ours), which correctly implements ToString(). Cardinalities.Instance is of type IEnumerable<Cardinality>.
Any suggestions? All that I want is that the "filter" text box and buttons are shown as for the other columns.
Thanks
Oskar.
Indeed, I was not clear enough. Please excuse me for this. In addition to my previous reply, I would suggest you to check the last reply in this forum thread. It contains the needed information for achieving the desired behaviour. For convenience I will paste Maya's answer here as well:
The thing is that when you work with ItemsSourceBinding, distinct values in the filtering control cannot be aware (and thus convert) each original value (the one the column is bound to) to a new one (that you want to display - CountryName instead of CountryID for example) since there is no exact and equal connection between a data item and value from the source of the column. And there is no appropriate way for us to notify the grid as the whole logic is inside each customer's business objects.
There is a possibility to convert the original distinct value to a new one (this will be just visual convertion, the data below will be the same) as illustrated in this forum thread. However, this again is appropriate only if you have only one pair of distinct value - item.
The way to go is to expose a new read-only property that will contain the value to be displayed in the combo box column and set it as FilterMemberPath for the ComboBoxColumn.
Yoan
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>

Ok, thanks a lot! That cleared it up for me, I got it working now.
I'd like to suggest to add an explicit example either to the "Basic Filtering" page or the "ComboBox Column" page that explains how to get the filter to work. Now that I know how the FilterMemberPath works it makes sense, but I definitely didn't get that from the docs (which I did read before).
Thanks again for your help
Oskar.
Thank you for the feedback. We will update the documentation with that additional information. Moreover, I will add a demo project to our SDK examples on Github.
Regards,Yoan
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>