Hi,
I have to parse FilterExpression string (grd.MasterTableView.FilterExpression), and I look for some pattern for this string.
I get Filter Expressions like:
(iif(firstname == null, "", firstname).ToString().Contains("a"))
Now I use this pattern (Regex):
.*\\(.*,.*,(.*)\\)\\..*\\.(.*)\\(\"(.*)\"\\)\\)
so I get column name, current filter function and input text.
But I'm not sure it'll be correct in all cases.
Please, help me to find valid pattern for FilterExpression.
Thanx
I have to parse FilterExpression string (grd.MasterTableView.FilterExpression), and I look for some pattern for this string.
I get Filter Expressions like:
(iif(firstname == null, "", firstname).ToString().Contains("a"))
Now I use this pattern (Regex):
.*\\(.*,.*,(.*)\\)\\..*\\.(.*)\\(\"(.*)\"\\)\\)
so I get column name, current filter function and input text.
But I'm not sure it'll be correct in all cases.
Please, help me to find valid pattern for FilterExpression.
Thanx
9 Answers, 1 is accepted
0
Hi Katya,
Another option in this case would be to simply iterate through the columns, and get the currentFilterFunction and CurrentFilterValue. Additional information on the syntax is available in the following article:
http://www.telerik.com/help/aspnet-ajax/grdapplyingdefaultfilteroninitialload.html
I hope this helps.
Regards,
Yavor
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Another option in this case would be to simply iterate through the columns, and get the currentFilterFunction and CurrentFilterValue. Additional information on the syntax is available in the following article:
http://www.telerik.com/help/aspnet-ajax/grdapplyingdefaultfilteroninitialload.html
I hope this helps.
Regards,
Yavor
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Katya
Top achievements
Rank 1
answered on 09 Oct 2009, 09:15 AM
Thank you for reply,
I have the following situation:
1. There is any radGrid
2. User input filters criteria and then select any grid item
3. After this, user redirect to another page
4. At new page the rad grid must looks like it was before redirect, with all settings
Cause i have redirect, I have to save filter expression in the Session.
I wouldn't like to save more settings in session.
So, when the page prerender, I try to parse this string. But I don't understand on which principle it's constructed...
Thank you in advance
I have the following situation:
1. There is any radGrid
2. User input filters criteria and then select any grid item
3. After this, user redirect to another page
4. At new page the rad grid must looks like it was before redirect, with all settings
Cause i have redirect, I have to save filter expression in the Session.
I wouldn't like to save more settings in session.
So, when the page prerender, I try to parse this string. But I don't understand on which principle it's constructed...
Thank you in advance
0
Hi Katya,
Why not save/restore directly as string?
All the best,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Why not save/restore directly as string?
All the best,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Katya
Top achievements
Rank 1
answered on 09 Oct 2009, 03:48 PM
Hi Vlad,
yes, I save and restore filterExpression directly as string. So, I get filtered items in my grid.
But I don't get text in input field and don't get filterFunction for each column.
The following link describe the similar situation: http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-gridsettingspersister-filter-states.aspx
I don't have an answer for my general question: how is the filter expression constructed?
Thanx
yes, I save and restore filterExpression directly as string. So, I get filtered items in my grid.
But I don't get text in input field and don't get filterFunction for each column.
The following link describe the similar situation: http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-gridsettingspersister-filter-states.aspx
I don't have an answer for my general question: how is the filter expression constructed?
Thanx
0
Hello Katya,
The FilterExpression of the grid follows the concepts of the DataView.Filter property structure as explained in this topic from the product documentation.
Best regards,
Sebastian
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
The FilterExpression of the grid follows the concepts of the DataView.Filter property structure as explained in this topic from the product documentation.
Best regards,
Sebastian
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Katya
Top achievements
Rank 1
answered on 13 Oct 2009, 01:26 PM
Hi,
i still have no solution for my problem.
Is there any way to get all needed info from filter expression string?
Thanx
i still have no solution for my problem.
- Reading the topic, I understood that it's possible to determine "what filter function the grid is currently employing"
- I need to save all filter settings for each column and restore its after redirect
- But I don't want to store this info for each column in Session
- I want to save only one string - filterExpression string, which consist all needed info
Is there any way to get all needed info from filter expression string?
Thanx
0
Accepted
Hello Katya,
I think that this help topic will help you achieve your goal:
http://www.telerik.com/help/aspnet-ajax/grdsavingsettingsonperuserbasis.html
Refer to the part which saves and restores the filter expression value.
Best regards,
Sebastian
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I think that this help topic will help you achieve your goal:
http://www.telerik.com/help/aspnet-ajax/grdsavingsettingsonperuserbasis.html
Refer to the part which saves and restores the filter expression value.
Best regards,
Sebastian
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Katya
Top achievements
Rank 1
answered on 13 Oct 2009, 03:17 PM
Thank you for reply,
I already read this solution, but it required to save array of settings - Pair[] columnFilter at least. But I want save only one string.
Please, refer to this (already posted), it's the similar problem:
http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-gridsettingspersister-filter-states.aspx
Please, answer, how the expression is constructed? Can I be sure that all strings I get will be like this:
(iif(firstname == null, "", firstname).ToString().ToUpper().Contains("a".ToUpper()))
Where is the column name position in this string? I see, that now it's the 3d parameter in breaks, but is it always true? What is "iif"? Is it any regular expression for this?
Thanx
I already read this solution, but it required to save array of settings - Pair[] columnFilter at least. But I want save only one string.
Please, refer to this (already posted), it's the similar problem:
http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-gridsettingspersister-filter-states.aspx
Please, answer, how the expression is constructed? Can I be sure that all strings I get will be like this:
(iif(firstname == null, "", firstname).ToString().ToUpper().Contains("a".ToUpper()))
Where is the column name position in this string? I see, that now it's the 3d parameter in breaks, but is it always true? What is "iif"? Is it any regular expression for this?
Thanx
0
Katya
Top achievements
Rank 1
answered on 13 Oct 2009, 03:55 PM
ok, I'll save array of parameters in the Session)
Thank you in advance!
Thank you in advance!
