Problem with .1017 and custom filter control

7 posts, 1 answers
  1. Patrick
    Patrick avatar
    504 posts
    Member since:
    Aug 2012

    Posted 12 Nov 2012 Link to this post

    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
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 12 Nov 2012 Link to this post

    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.

  3. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 12 Nov 2012 Link to this post

    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.

  4. Patrick
    Patrick avatar
    504 posts
    Member since:
    Aug 2012

    Posted 12 Nov 2012 Link to this post

    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
  5. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 12 Nov 2012 Link to this post

    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.

  6. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2477 posts

    Posted 12 Nov 2012 Link to this post

    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.

  7. Patrick
    Patrick avatar
    504 posts
    Member since:
    Aug 2012

    Posted 12 Nov 2012 Link to this post

    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
Back to Top