Hi all,
I am trying to understand how I can do a multiple column filtering but I could not find an appropriate resource for that. Obviously I am missing it, but can you please help me finding a good one? After filtering in a column, how can I do a second filtering in another column so that it becomes a second derivative filtering over the first one?
Example:
Column1 Column2
3 A
4 B
6 C
5 C
5 D
After the 1st filtering; FilterItem: 5, Column1
Column1 Column2
5 C
5 D
2nd Filtering; FilterItem: C, Column2
Column1 Column2
5 C
Thanks,
Ervin
I am trying to understand how I can do a multiple column filtering but I could not find an appropriate resource for that. Obviously I am missing it, but can you please help me finding a good one? After filtering in a column, how can I do a second filtering in another column so that it becomes a second derivative filtering over the first one?
Example:
Column1 Column2
3 A
4 B
6 C
5 C
5 D
After the 1st filtering; FilterItem: 5, Column1
Column1 Column2
5 C
5 D
2nd Filtering; FilterItem: C, Column2
Column1 Column2
5 C
Thanks,
Ervin
7 Answers, 1 is accepted
0

mohamed
Top achievements
Rank 1
answered on 08 Oct 2011, 02:23 PM
Hello ervin,
Where you filer the two columns
Check the below link,
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/filtering/defaultcs.aspx
Thanks,
Mohamed.
Where you filer the two columns
Check the below link,
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/filtering/defaultcs.aspx
Thanks,
Mohamed.
0

ervin
Top achievements
Rank 1
answered on 05 Dec 2011, 05:47 PM
Hello All,
I am trying to set multiple filter for my RadGrid which was created and populated programmatically. Described below message, I need to set the multiple filter but I can not preserve state nor multiple filter functionality. I tried the link provided by Mohamed (Thank you for your help!) but it did not work as my grid was created programmatically.
What can I do to preserve the state in a filter?
And how can I have a multiple filter functionality programmatically? I need the same functionality described in "Basic Filter Demo" but I am not able to do.
Waiting your help,
Best,
Ervin
I am trying to set multiple filter for my RadGrid which was created and populated programmatically. Described below message, I need to set the multiple filter but I can not preserve state nor multiple filter functionality. I tried the link provided by Mohamed (Thank you for your help!) but it did not work as my grid was created programmatically.
What can I do to preserve the state in a filter?
And how can I have a multiple filter functionality programmatically? I need the same functionality described in "Basic Filter Demo" but I am not able to do.
Waiting your help,
Best,
Ervin
0

ervin
Top achievements
Rank 1
answered on 07 Dec 2011, 03:38 PM
Please help me? I am still waiting your replies...
0

ervin
Top achievements
Rank 1
answered on 07 Dec 2011, 10:46 PM
Ok, the problem in my script is
RadGrid1.Columns.Add(boundcol(index))...
When I add my GridBoundColumn to the RadGrid, enablecolumnsviewstate start not to work. Before adding the columns everything works fine (I can see the filterItem in the filterbox after filtering etc.) What should I do to preserve the state (enablecolumnsviewstate=true) when I add a GridBoundColumn to RadGrid1 programmatically ?
Thanks,
Ervin
RadGrid1.Columns.Add(boundcol(index))...
When I add my GridBoundColumn to the RadGrid, enablecolumnsviewstate start not to work. Before adding the columns everything works fine (I can see the filterItem in the filterbox after filtering etc.) What should I do to preserve the state (enablecolumnsviewstate=true) when I add a GridBoundColumn to RadGrid1 programmatically ?
Thanks,
Ervin
0
Hello Ervin,
Please ensure that you are creating the programmatic Grid correctly in the specific event you are using. Review the following help topic and ensure tat you are following the described steps:
http://www.telerik.com/help/aspnet-ajax/grid-programmatic-creation.html
Kind regards,
Maria Ilieva
the Telerik team
Please ensure that you are creating the programmatic Grid correctly in the specific event you are using. Review the following help topic and ensure tat you are following the described steps:
http://www.telerik.com/help/aspnet-ajax/grid-programmatic-creation.html
Kind regards,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0

ervin
Top achievements
Rank 1
answered on 13 Dec 2011, 09:26 PM
Hi Maria,
The problem in my code is that, it has to populate the related dataset first to create/add the grid columns.
The data coming from the dataset has the necessary information like # of the columns, column names etc. so it creates/adds the columns to the grid dynamically using this data.
If I get this necessary information from the dataset each time it hits to the Page_Load, it is gonna be a very big resource/time misuse. (If you think that there are more than 3 grids in each Page and it needs to populate another dataset for each grid) To avoid that, I tried to solve the problem by populating just the singleRow (using a reader instead of ds) and loading it to the dataset instead of populating a dataset and getting hundreds of unnecessary rows. It worked fine but it still uses 3 different stored procedures in a Page_Load so that it is still a huge amount of resource misuse and it is still not accceptable.
I know that I can not change the dynamic structure of my code's column creation where columns have been created after getting the necessary data from ds. And I know that I need to use Page_Load too to make the multi filtering work. So I could not solve the issue... Do I have a chance to overcome this problem and make multi filtering work somehow?
Thanks,
Ervin
The problem in my code is that, it has to populate the related dataset first to create/add the grid columns.
The data coming from the dataset has the necessary information like # of the columns, column names etc. so it creates/adds the columns to the grid dynamically using this data.
If I get this necessary information from the dataset each time it hits to the Page_Load, it is gonna be a very big resource/time misuse. (If you think that there are more than 3 grids in each Page and it needs to populate another dataset for each grid) To avoid that, I tried to solve the problem by populating just the singleRow (using a reader instead of ds) and loading it to the dataset instead of populating a dataset and getting hundreds of unnecessary rows. It worked fine but it still uses 3 different stored procedures in a Page_Load so that it is still a huge amount of resource misuse and it is still not accceptable.
I know that I can not change the dynamic structure of my code's column creation where columns have been created after getting the necessary data from ds. And I know that I need to use Page_Load too to make the multi filtering work. So I could not solve the issue... Do I have a chance to overcome this problem and make multi filtering work somehow?
Thanks,
Ervin
0
Hello Ervin,
Note that you do definitely need the ViewState if you are to have multi-column filtering. So the required functionality is not supported in your case. As for a work-around for maintaining the FilterExpression, you can certainly do so by keeping the CurrentFilterValue and CurrentFilterFunction in a ViewState or Session variable and construct the filter expression over and over again on each postback.
So you should construct the filter expression manually, so you can take a look at the following help article and see the syntax and coding needed, depending on your grid's datasource:
Operating with the FilterExpression of Telerik RadGrid Manually
Also, you can consider using a RadFilter for filtering if you do not want to build the filter expression manually:
RadGrid filtering with RadFilter
I hope this helps.
Greetings,
Maria Ilieva
the Telerik team
Note that you do definitely need the ViewState if you are to have multi-column filtering. So the required functionality is not supported in your case. As for a work-around for maintaining the FilterExpression, you can certainly do so by keeping the CurrentFilterValue and CurrentFilterFunction in a ViewState or Session variable and construct the filter expression over and over again on each postback.
So you should construct the filter expression manually, so you can take a look at the following help article and see the syntax and coding needed, depending on your grid's datasource:
Operating with the FilterExpression of Telerik RadGrid Manually
Also, you can consider using a RadFilter for filtering if you do not want to build the filter expression manually:
RadGrid filtering with RadFilter
I hope this helps.
Greetings,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now