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

Filtering with custom template

2 Answers 93 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Gergely
Top achievements
Rank 1
Gergely asked on 13 Mar 2011, 09:13 PM
Hi

In my application, I have created a custom template that can display ID - Name pairs in one cell. The problem is, that I cannot use filtering in this case.

I have specified DataMemberBinding for the column, but instead of binding directly to a property, I use a converter on the Binding to retrieve the value from the data object (converter gets the id and the name and puts them in a string). The converter works well in Excel export, however filtering options is still missing in the GUI.

Binding bnd0 = new Binding(".");
            bnd0.Converter = new IDValueColumnToStringConverter();
            bnd0.Mode = BindingMode.OneWay;
...
return new GridViewDataColumn() {... DataMemberBinding=bnd0 };

Filtering icon is not displayed at all. Is there any workaround on this issue? Can I write custom filtering methods, but use the design of Telerik filtering dialogs?

Thanks for the help in advance,
                                                     G. M.

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 14 Mar 2011, 08:12 AM
Hi,

 Possible solution will be to use the approach from this demo

All the best,
Vlad
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Gergely
Top achievements
Rank 1
answered on 15 Mar 2011, 09:27 AM
Well... we are using the little filter icon at the row header, since there is not much space above the grids. Is it possible to use this icon and create a filter, which is based on custom logic, but appears as standard telerik filters?

It would be enough if the filter would use the converter of the DataMember, since the return value of the converter is what we want to filter by. (Or it would be also a solution, if I could specify the list of values manually.)
Tags
GridView
Asked by
Gergely
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Gergely
Top achievements
Rank 1
Share this question
or