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

Problem with .1017 and custom filter control

6 Answers 26 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Patrick asked on 12 Nov 2012, 10:55 AM
Hello,

In version .912, I've defined a custom filter control, deriving from Telerik.Windows.Controls.GridView.FilteringControl.
In the Prepare method, I just change the default filter operators to have Contains by default (text search).
This was working fine.

In version .1017, the same code does not work anymore: the filter is no more displayed. I've tried by just replacing the FilterControl of the grid view with a custom filter that just descend from Telerik's FilteringControl and does nothing else. In this case also, the filter is no more displayed!

What should I correct with the new version to make it work again?

Patrick

6 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 12 Nov 2012, 12:34 PM
Hi Patrick,

You say that your code was working before the upgrade from version .912 to the latest version, but now it is not working any more. As we are not aware of a such an issue, may I ask you to isolate the problem in a Demo project showing how you apply the Custom FilterControl? That way we will debug it locally and advise you further.

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Dimitrina
Telerik team
answered on 12 Nov 2012, 12:36 PM
Hi Patrick,

You say that your code was working before the upgrade from version .912 to the latest version, but now it is not working any more. As we are not aware of a such an issue, may I ask you to isolate the problem in a Demo project showing how you apply the Custom FilterControl? That way we will debug it locally and advise you further.

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
answered on 12 Nov 2012, 03:06 PM
Hi Didie,
I've looked more closely to the problem and it's not related to the new version of RadControls, but to the use of implicit styles. It seems that, when using implicit styles, the custom filter has no style, so it is not shown on the screen.
In my case, I create a custom filter just to initialize correctly the operators in the filter (to have Contains as a default for a text column), each time it is shown. But I want to use the default style of the filter window.

Do you have a solution for this?

Patrick
0
Accepted
Dimitrina
Telerik team
answered on 12 Nov 2012, 03:17 PM
Hello Patrick,

Thank you for sharing that additional information.

In case of using Implicit Themes, you should add a BasedOn attribute to the Style definition you have. Please check this help article for details and an example on how to do that.

Greetings,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Rossen Hristov
Telerik team
answered on 12 Nov 2012, 03:36 PM
Hi,

You mentioned that "In my case, I create a custom filter just to initialize correctly the operators in the filter (to have Contains as a default for a text column), each time it is shown. But I want to use the default style of the filter window."

In this case you do not need to go through all this hassle with the custom filtering controls. You can change the default operator with a single line as described here.

Kind regards,
Rossen Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
answered on 12 Nov 2012, 04:11 PM
Hi Rossen,
I know this tip, but I had to write this code for each column of each data grid. As I currently have about 40 different grid views (and more to come), with many columns. It's very long and complicated to to this correctly for all of them.

Instead, I defined classes for columns of type Text and Date (for the moment, more to come later). The column constructor defines the properties correctly and redefines the filter. That's a lot more work at the beginning, but now I can define columns as:
<myctrl:osRadGridViewTextColumn DataMemberBinding="{Binding Title}"
                                Header="{Binding ResourceText, Converter={StaticResource ResourceText}, ConverterParameter=Beach.Tournament.List.Header.Title, ElementName=TextRes}"
                                UniqueName="Title"
                                Width="350"/>
 
<myctrl:GridViewDateColumn DataMemberBinding="{Binding StartDate.Date}"
                           Header="{Binding ResourceText, Converter={StaticResource ResourceText}, ConverterParameter=Beach.Tournament.List.Header.StartDate, ElementName=TextRes}"
                           UniqueName="StartDate"
                           Width="90"/>

That's much more simpler at using the column: no need for code-behind....

Patrick
Tags
GridView
Asked by
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dimitrina
Telerik team
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Rossen Hristov
Telerik team
Share this question
or