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

Google Like Filtering

5 Answers 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 1
Gary asked on 17 Jun 2015, 02:33 PM

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

5 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 22 Jun 2015, 11:09 AM
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
0
Gary
Top achievements
Rank 1
answered on 24 Jun 2015, 08:39 AM

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

 

0
Viktor Tachev
Telerik team
answered on 26 Jun 2015, 02:43 PM
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
0
Gary
Top achievements
Rank 1
answered on 29 Jun 2015, 08:03 AM
We use server side viewstate, so that isn't an issue.
0
Konstantin Dikov
Telerik team
answered on 02 Jul 2015, 07:16 AM
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
Tags
Grid
Asked by
Gary
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Gary
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or