How to handle Filter Button event

12 posts, 0 answers
  1. Pushpendra
    Pushpendra avatar
    32 posts
    Member since:
    Nov 2012

    Posted 04 Dec 2012 Link to this post

    Hi,

    How can I handle Filter Button event of RadGridView Filter Popup Window?

    Thanks,
    Pushpendra
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2477 posts

    Posted 04 Dec 2012 Link to this post

    Hello,

    What is the reason for handling this event?

    All the best,
    Rossen Hristov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Pushpendra
    Pushpendra avatar
    32 posts
    Member since:
    Nov 2012

    Posted 04 Dec 2012 Link to this post

    Hi Rossen,

    By clicking on the Filter button I want to perform server side search using FilterDescriptors, so need to handle Filter Button Click event.

    Thanks,
    Pushpendra
  4. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 04 Dec 2012 Link to this post

    Hello,

     For server-side filtering you can use WCF RIA services or WCF Data services

    Kind regards,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Pushpendra
    Pushpendra avatar
    32 posts
    Member since:
    Nov 2012

    Posted 04 Dec 2012 Link to this post

    Hi Vlad,

    As per my requierment I have to handle Filter button Click event of RadGridView Filtring popup, can we achieve that?
    Also I have tried to open these links but it is asking for Silverlight 5, and my application is on Silverlight 4 with Telerik Q2 2011 SP1. Can we do Server side filtring using these versions?

    Regards,
    Pushpendra
  6. Pushpendra
    Pushpendra avatar
    32 posts
    Member since:
    Nov 2012

    Posted 04 Dec 2012 Link to this post

    Hi,

    Can we handle Filter Button event of RadGridView Filter Popup Window, if yes how?

    Thanks,
    Pushpendra

  7. Pushpendra
    Pushpendra avatar
    32 posts
    Member since:
    Nov 2012

    Posted 06 Dec 2012 Link to this post

    Hi,

    Is it possible to find out "PART_ApplyFilterButton" from the GridView Filtring Control?  I have tried to find Filtring Control and Filter Button using "ChildrenOfType" but it is always returning null.
    gridView1.ChildrenOfType<Button>().Where(b => b.Name == "PART_ApplyFilterButton").ToList(); 
    gridView1.ChildrenOfType<FilteringControl>().Where(b => b.Name == "PART_DisctinctFilter").ToList();

    Please suggest how can I find filter button.

    Thanks,
    Pushpendra
  8. Pushpendra
    Pushpendra avatar
    32 posts
    Member since:
    Nov 2012

    Posted 07 Dec 2012 Link to this post

    Hi,

    Can anyone will please tell that:
    Is it possible to handle Filter Button event of RadGridView Filtering Popup so that I can cancel its default search and perform my own based on its Filter Criteria, in any Telerik Control Version.
    Can we do this or not? It is very urgent to me.

    Thanks,
    Pushpendra
  9. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2477 posts

    Posted 07 Dec 2012 Link to this post

    Hi,

    You can attach to the Filtering or Filtered event of the grid and perform your custom filtering. But if you cancel the Filtering event -- you will use the values that the user has entered in the UI so that is not advisable.

    Kind regards,
    Rossen Hristov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  10. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2477 posts

    Posted 07 Dec 2012 Link to this post

    Hello,

    I meant you will lose the values that the user has entered in the UI.

    Anyway, this button is not in the grid. It is in the filtering control which is shown in a Popup only when the user clicks. So you cannot find it like this.

    If you really want to find this button, you have to inherit from our stock FilteringControl class, assing your inhertied class to the FilteringControl property of the column and then override the OnApplyTemplate method. There you can find the button with ChildrenOfType.

    But again, if you cancel the filtering of the grid all values thaty user entered will be lost.

    The documentation has more details about custom filtering controls and other aspects of filtering. Please, check the docs.

    Greetings,
    Rossen Hristov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  11. Pushpendra
    Pushpendra avatar
    32 posts
    Member since:
    Nov 2012

    Posted 07 Dec 2012 Link to this post

    Hi Rossen,

    Thanks for the reply. Yes I tried Filtering event but in Filtring event values are present in "e.Added" and not in "e.ColumnFilterDescriptor", and from "e.Added" we can't find out that the value is from DistinctFilter or from FieldFilter so it is not working. Also I was trying to search the Filter button to implement the solution but in that case also if I will not get the user input then it is of no use.
    Actually this is a client requirement we are hanged on it. Also we can't use WCF Ria Service / WCF Data Service only for Filtring, since we can't change our whole architecture using which we are managing huge amount of data using custom paging.
    Please let us know if there is any other solution for this issue.

    Thanks,
    Pushpendra
  12. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2477 posts

    Posted 07 Dec 2012 Link to this post

    Hi,

    1. You can implement your very own custom filtering control and you will have total freedom over everything.

    2. If you decide to stick with our stock FilteringControl, you can implement a custom ColumnFilterDescriptor inheriting from our stock ColumnFilterDescriptor. Since you don't want the grid to do any filtering at all, your custom ColumnFilterDescriptor can return a Expression.Contstant(true, typeof(bool))  LINQ expression, meaning that all records pass the filter. Since your custom ColumnFilterDescriptor is inheriting from our stock one, you will be able to read the data that the user has entered by examining base.* properties. Based on this data, you can perfrom any kind of "outside" filtering.

    I have attached two sample projects that utilize a custom ColumnFilterDescriptor. While they are not meant for your case exactly, you can examine and debug them in order to tailor them for your specific requirement.

    Regards,
    Rossen Hristov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top