unnikkannan m
Top achievements
Rank 1
unnikkannan m
asked on 06 Aug 2009, 09:03 AM
Hello Sir,
In radgrid is it possible to clear the filter expression value client
side. i'm getting the filter expression value client side,
how could we clear the filter expression in client side.
can we clear the filter value entered be cleared through
the script.
when filtering using the special characters for filtering its
creating error.
Give me a solution
Thanks in advance
Unni
In radgrid is it possible to clear the filter expression value client
side. i'm getting the filter expression value client side,
how could we clear the filter expression in client side.
can we clear the filter value entered be cleared through
the script.
when filtering using the special characters for filtering its
creating error.
Give me a solution
Thanks in advance
Unni
6 Answers, 1 is accepted
0
Peter
Top achievements
Rank 1
answered on 10 Aug 2009, 03:29 PM
Hello,
Could you specify what your goal exactly is? In general you cannot clear the Filter expression on the client side. This is expected, because when any changed in the FilterExpression collection is made you will need to rebind the grid. You can clear the FilterExpression collection on the server and rebind the grid.
Greetings.
Could you specify what your goal exactly is? In general you cannot clear the Filter expression on the client side. This is expected, because when any changed in the FilterExpression collection is made you will need to rebind the grid. You can clear the FilterExpression collection on the server and rebind the grid.
Greetings.
0
unnikkannan m
Top achievements
Rank 1
answered on 11 Aug 2009, 04:45 AM
hello
when we are entering special characters in the filtertextbox
and go for filtering then it causes error. I tried to check
whether there's special characters other than in the
filter expression, if found then canceled the filter
operation. But the problem is that it throws
system.outofmemory exception.
That's why I need to clear the filter expression
in the client side itself.
unni
when we are entering special characters in the filtertextbox
and go for filtering then it causes error. I tried to check
whether there's special characters other than in the
filter expression, if found then canceled the filter
operation. But the problem is that it throws
system.outofmemory exception.
That's why I need to clear the filter expression
in the client side itself.
unni
0
Accepted
Hello unnikkannan,
You can clear the filter expressions on the client, as follows:
In addition, the best way to achieve your scenario is to attach an event handler to the OnCommand client event of the grid, check the args.get_commandArgument() for any invalid characters and cancel the filter operation on the client through args.set_cancel(true). In this way, there will be no need to clear the filter expressions manually.
I hope this helps.
Regards,
Tsvetoslav
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
You can clear the filter expressions on the client, as follows:
| $find('<%=RadGrid1.ClientID%>').get_masterTableView().get_filterExpressions().clear(); |
In addition, the best way to achieve your scenario is to attach an event handler to the OnCommand client event of the grid, check the args.get_commandArgument() for any invalid characters and cancel the filter operation on the client through args.set_cancel(true). In this way, there will be no need to clear the filter expressions manually.
I hope this helps.
Regards,
Tsvetoslav
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
unnikkannan m
Top achievements
Rank 1
answered on 13 Aug 2009, 06:45 AM
Hello Tsvetoslav,
I used the function given below in oncommand client event inorder to check
the filter expression and it worked
function CheckFilterExpression(source, args) {
var tableView = source.get_masterTableView();
var t = args.get_commandName();
if (t == "Filter") {
var filterValue = tableView.get_filterExpressions();
var regx, flg;
regx = /[^0-9a-zA-Z\[\]\(\)%'' ]/
flg = regx.test(filterValue);
if (flg) {
args.set_cancel(true);
}
}
}
thanks you very much for your answer
Unni
I used the function given below in oncommand client event inorder to check
the filter expression and it worked
function CheckFilterExpression(source, args) {
var tableView = source.get_masterTableView();
var t = args.get_commandName();
if (t == "Filter") {
var filterValue = tableView.get_filterExpressions();
var regx, flg;
regx = /[^0-9a-zA-Z\[\]\(\)%'' ]/
flg = regx.test(filterValue);
if (flg) {
args.set_cancel(true);
}
}
}
thanks you very much for your answer
Unni
0
unnikkannan m
Top achievements
Rank 1
answered on 24 Aug 2009, 07:14 AM
Hello Tsvetoslav
I could cancel the filter operation while entering some special characters and it worked fine in mozilla.
But when we are filtering using "IsEmpty, NoIsEmpty, IsNull, NotIsNull' in IE it causes the error---
"Sys.WebForms.PageRequestManagerServer ExceptionError:An unknown error while processing the request on the server. The status code returned from the server was 500"
Please help me to solve this problem
Unni
I could cancel the filter operation while entering some special characters and it worked fine in mozilla.
But when we are filtering using "IsEmpty, NoIsEmpty, IsNull, NotIsNull' in IE it causes the error---
"Sys.WebForms.PageRequestManagerServer ExceptionError:An unknown error while processing the request on the server. The status code returned from the server was 500"
Please help me to solve this problem
Unni
0
Hello unnikkannan,
You need to change your OnCommand handler as follows:
Other than that, I could not reproduce the exception you are getting as evidenced by the attached sample. Could you try modifying the latter so that the error is reproduced and get back with more information.
Thank you.
Best wishes,
Tsvetoslav
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
You need to change your OnCommand handler as follows:
| function onCommand(source, args) { |
| var tableView = source.get_masterTableView(); |
| var t = args.get_commandName(); |
| if (t == "Filter") { |
| var filterValue = args.get_commandArgument().split('|')[1]; |
| var regx, flg; |
| regx = /[^0-9a-zA-Z\[\]\(\)%'' ]/ |
| flg = regx.test(filterValue); |
| if (flg) { |
| args.set_cancel(true); |
| } |
| } |
| } |
Other than that, I could not reproduce the exception you are getting as evidenced by the attached sample. Could you try modifying the latter so that the error is reproduced and get back with more information.
Thank you.
Best wishes,
Tsvetoslav
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.