(828) 862-6667

Telerik Blogs



SQL Server Syntax for RADGrid Filter Expression

by Rich Winslow | Apr 25, 2011

Have you been frustrated trying to save and restore RADGrid filter expressions easily?

Are you trying to programmatically set the RADGrid Filter?

By default, the RADGrid is set for LINQ syntax.  If you'd like to use MS SQL Server syntax, then simply add the following attribute to the RADGrid control:


<telerik:RadGrid Id='grdTest' EnableLinqExpressions='false'>
</telerik:RadGrid>


With LINQ expressions turned off, you can set the RadGrid filter expression as follows:



grdTest.MasterTableView.FilterExpression = "[CustomerName] = 'Test Customer'"


You can also obtain the RadGrid filter expression as follows:



Dim strFilterExpression = grdTest.MasterTableView.FilterExpression()


Simple but effective!

Comment

  1.    
     
     
      
       

SQL Server Syntax for RADGrid Filter Expression

by Rich Winslow | Apr 25, 2011

Have you been frustrated trying to save and restore RADGrid filter expressions easily?

Are you trying to programmatically set the RADGrid Filter?

By default, the RADGrid is set for LINQ syntax.  If you'd like to use MS SQL Server syntax, then simply add the following attribute to the RADGrid control:


<telerik:RadGrid Id='grdTest' EnableLinqExpressions='false'>
</telerik:RadGrid>


With LINQ expressions turned off, you can set the RadGrid filter expression as follows:



grdTest.MasterTableView.FilterExpression = "[CustomerName] = 'Test Customer'"


You can also obtain the RadGrid filter expression as follows:



Dim strFilterExpression = grdTest.MasterTableView.FilterExpression()


Simple but effective!

Comment

  1.    
     
     
      
       















Company Info  |   Contact Us  |   Site Map  |   Terms  |   Privacy Policy  |  

Automated Results Computer Consulting LLC, 222 South Caldwell Street, Brevard, NC 28712 (828) 862-6667