"Syntax error: Missing operand after '["column"]' operator."
We get a different error when filtering an INT column:
"The expression contrain undefined function call Convert.ToDecimal()."
Then to top it off when leaving the page we get a "null object" error but only when the grid is filter, sorted, or grouped by using the HeaderContextFilterMenu. If you turn this feature off and sort, filter, or group by the default method it doesn't throw this error.
I am not sure what changed but this is a deal breaker for us. We wil most likely have to roll back so any help would be greatly appreciated.
5 Answers, 1 is accepted
New FilterExpression looks like this "(it[\"InsuredTypeName\"].ToString().Contains(\"Ben\"))"
It appears to be something custom for RadGrids. Anyone have an idea how to get the standard row filter out of the RadGrid.MasterTableView?
Also the error 2 with refreshing or leaving the page is still an issue with the HeaderContextFilterMenu.
My error 1 can be fixed by Disable Linq Expression in the RadGrid with the attribute "EnableLinqExpressions." This isn't good enough though because now I'm curious as to how we can take a Linq Filter Expression and filter a DataView.
I did downloaded the Dynamic Linq Library but couldn't find anywhere that they are buliding Linq quieries from a string that looks like the radGrid.MasterTableView.FilterExpression.
I wish it where easy like so.
newTable = tableOne.AsEnumerable()
Has anyone built a new DataView from this filterExpression?
RadGrid of RadControls for ASP.NET AJAX uses different syntax for building filter expressions for 3.*/4.0 framework.
If you need to filter DataTable with FilterExpressions build from RadGrid you should include DynamicLinq and use following line to achieve it:
the Telerik team
Thanks it works great I had to add some defensive code because in some instances the filterexpression is blank and or the datasource is empty.