Google Like Filtering

6 posts, 0 answers
  1. Gary
    Gary avatar
    6 posts
    Member since:
    Oct 2012

    Posted 17 Jun 2015 Link to this post

    Hi,

    I have implemented the filtering using a combobox as shown in this article: 

    http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/functionality/filtering/google-like-filtering

    I am wondering if its possible once one column is filtered to restrict what's available in the other combobox filters?

    So if I filter on the first two columns, I want the next column filter to only show what is available in the grid after filtering, not what is in the datasource.

    Thanks

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2469 posts

    Posted 22 Jun 2015 Link to this post

    Hi Gary,

    In order to have the RadComboBox filters show only the relevant items from the data source you should get the FilterExpression for the grid. Then you can use that expression in the query that retrieves data for the RadComboBox.

    I have prepared a sample project that outlines the approach. It is attached to this post.

    Try to use similar approach and you should be able to implement the behavior you are looking for.


    Regards,
    Viktor Tachev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Gary
    Gary avatar
    6 posts
    Member since:
    Oct 2012

    Posted 24 Jun 2015 Link to this post

    Hi,

    Thanks for the response and sample demo.

    We are using viewstate to store the grid's datasource in the usercontrol that contains the grid. Is there any way to access the Grid's Datasource from the custom column in order to filter on it as per your example?

    I know we could store it in each column but obviously that would consume more memory. Currently setting the comboboxes datasource as a list of strings - this is being set in the onNeedDataSource event of the grid, selecting the relevant field for that column.

     

    Thanks,

    Gary

     

  4. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2469 posts

    Posted 26 Jun 2015 Link to this post

    Hello Gary,

    Note that keeping large amount of data in the ViewState is not recommended and should be avoided. This could considerably hinder the performance of the application.

    In the sample the data for the RadComBox is retrieved from the database. Usually the connection between the database and the web server would be a lot faster than the connection of the end user. Thus, this approach should work faster than using the ViewState to store the data. When having a large ViewState the user will need to download it and that could negatively impact the user experience.


    Regards,
    Viktor Tachev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Gary
    Gary avatar
    6 posts
    Member since:
    Oct 2012

    Posted 29 Jun 2015 Link to this post

    We use server side viewstate, so that isn't an issue.
  6. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 02 Jul 2015 Link to this post

    Hi Gary,

    The DataSource of the grid will be null within the OnItemRequested event of the RadComboBox control, so it will not be possible use that data source and set it to the DataSource property of the RadComboBox. The DataSource of the RadGrid will contain the data object only within the life cycle when the data is bound to the control. This means that you will have to retrieve the DataSource directly from the ViewState.
     
    Hope this helps.


    Regards,
    Konstantin Dikov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top