A collection of Telerik.Web.UI.GridFilterExpression objects. Represents the filter expressions applied for the grid instance.

The toString() javascript method executed over this collection will return SQL string representation of all filter expressions concatenated by 'AND' reserved words. While filter expressions toString() method will create SQL syntax representing current grid filtering, you can also take advantage of the toDynamicLinq() javascript method which will create LINQ expression that can be used directly with Dynamic LINQ library.

Furthermore, you can also utilize the toList() javascript method in order to pass an array of items (representing the filter expression elements) to the server and operate with them using GridFilterExpression server object.

When the toString() method is executed over a particular Telerik.Web.UI.GridFilterExpression object, it will return SQL string representation of the expression using the Telerik.Web.UI.GridFilterFunctionsSqlFormat enumeration values:

The toDynamicLinq() javascript method can be executed over a single Telerik.Web.UI.GridFilterExpression object, which will generate LINQ expression that can be used directly with Dynamic LINQ library.

Additionally, there is another method - toDataService(), which again can be executed over a single Telerik.Web.UI.GridFilterExpression object and will generate an expression that can be recognized by ADO.NET Data Services.

There is one more method - toOql() for filter expressions which can be used if you want to bind the grid client-side directly to Telerik OpenAccess OQL query. Here are some code blocks which illustrates sample approach:

Public Function GetData(ByVal startRowIndex As Integer, ByVal maximumRows As Integer, ByVal sortExpression As String, ByVal filterExpression As String) As IList
Dim oqlQuery As String = "SELECT * FROM CustomerExtent"
If Not [String].IsNullOrEmpty(filterExpression) Then
oqlQuery = [String].Format(" {0} WHERE {1} ", oqlQuery, filterExpression)
End If
If Not [String].IsNullOrEmpty(sortExpression) Then
oqlQuery = [String].Format(" {0} ORDER BY {1} ", oqlQuery, sortExpression)
End If
Dim data As IList = db.GetObjectScope().GetOqlQuery(oqlQuery).Execute()
Dim list As New List(Of Object)()
Dim i As Integer = 0
While i < Math.Min(maximumRows, data.Count)
list.Add(data(i + startRowIndex))
System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
End While
Session("Count") = data.Count
Return list
End Function

Each filter expression (of type Telerik.Web.UI.GridFilterExpression) has fieldName, fieldValue, columnUniqueName, dataTypeName and filterFunction properties which hold the field name, field value (filter pattern typed by the user), the unique name of the filtered column, the data type and the filter function applied to it (respectively). To retrieve the values from these properties use the get_fieldName(), get_fieldValue(), get_columnUniqueName().get_dataTypeName() and get_filterFunction() properties of the corresponding GridFilterExpression. Below is a sample code excerpt using OnCommand client-side event handler:

Give article feedback

Tell us how we can improve this article

Code samples are inaccurate/outdated.
I expected to find other/more information.
There are typos/broken links/broken page elements.
Content is inaccurate/outdated.
Other
By checking this box you consent to Progress contacting you by email about your response on this page.