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

Combobox filter instead of a Textbox in FilterRow mode

3 Answers 211 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bar
Top achievements
Rank 1
Bar asked on 24 Nov 2019, 02:54 PM

Hello,

I have telerik version 2014.1.331.40. I want to make a ComboBox filter in FilterRow mode in the RadGridView control. I need it to work exactly like the Textbox does, only with the ComboBox instead. I tried editing the control template of StringFilterEditor, but then I lose all functionality and when I try to bind the DisplayMemberPath, it doesn't work or when it does through code behind, it is very slow while I type what I want to Filter (I need to do Filter as you type which I did with the Textbox) (I use a large amount of Data).

Please help,

Bar.

3 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 27 Nov 2019, 01:35 PM

Hello Bar,

I've tested the described approach - with extracting the StringFilterEditor template - and it worked properly on my side. I only replaced the TextBox control with a RadComboBox. I've attached my project, I hope it helps.

Also, note that there is a feature request to allow easier customization of the field filter editor, logged in the feedback portal.

Regards,
Martin Ivanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Bar
Top achievements
Rank 1
answered on 27 Nov 2019, 02:27 PM

Hi,

Thank you! It helped me a lot. It seems that what I needed is this:

Text="{Binding Text, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"

This is what makes the Combobox work as the textBox.

When I began working on this I used this article: https://docs.telerik.com/devtools/wpf/controls/radgridview/styles-and-templates/styling-filterrow#modifying-the-fieldfiltercontrols-style

But unfortunately it doesn't mention what needs to be done with the text in order to retain the filtering functionality. Perhaps it should be added.

Thank you very much,

Bar.

0
Martin Ivanov
Telerik team
answered on 02 Dec 2019, 10:40 AM

Hello Bar,

I am glad that the project helped.

As for the article, indeed, it doesn't show how to bind the Text property. This is because, template customization is different based on the different scenarios and can contain any UI element. The article only points how to apply a style that sets properties of the control and also how to replace the template.

Regards,
Martin Ivanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
GridView
Asked by
Bar
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Bar
Top achievements
Rank 1
Share this question
or