New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Working With Items And Expressions

(OrderDate = '5/16/2021 12:00:00 AM' AND (ShipCountry = 'Bulgaria' OR ShipCountry = 'Germany'))
  • And
  • Or
  • Not And
  • Not Or
  • Contains
  • DoesNotContain
  • StartsWith
  • EndsWith
  • EqualTo
  • NotEqualTo
  • GreaterThan
  • LessThan
  • GreaterThanOrEqualTo
  • LessThanOrEqualTo
  • Between
  • NotBetween
  • IsEmpty
  • NotIsEmpty
  • IsNull
  • NotIsNull
  • ShipCountry
  • OrderDate

Order DateShip Country
5/16/2021 2:00:00 AMBulgaria
5/16/2021 11:00:00 AMGermany

This demo demonstrates how you could subscribe to RadFilter ExpressionItemCreated event and access and manipulate individual items.

Additionally, a time independent filtering functionality is shown by using the RadFilterQueryProvider.OnExpressionEvaluated delegate where the every EqualTo and NotEqualTo filter functions are swapped for Between and NotBetween so they could filter for the entire day and not for a specific hour, minute, second.

  • DefaultVB.aspx
  • DefaultVB.aspx.vb
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="DefaultVB.aspx.vb" Inherits="Telerik.FilterExamplesVB.CustomizingRadFilter.DefaultVB" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>

<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
  <div class="demo-container">
    <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1">
      <telerik:RadFilter RenderMode="Lightweight" runat="server" ID="RadFilter1"
        ExpressionPreviewPosition="Bottom"
        OperationMode="ServerAndClient"
        OnExpressionItemCreated="RadFilter1_ExpressionItemCreated"
        OnApplyExpressions="RadFilter1_ApplyExpressions">
        <FieldEditors>
          <telerik:RadFilterDropDownEditor FieldName="ShipCountry" DataTextField="ShipCountry"
            DataValueField="ShipCountry" />
          <telerik:RadFilterDateFieldEditor FieldName="OrderDate" PickerType="DatePicker" />
        </FieldEditors>
      </telerik:RadFilter>
      <br />
      <div>
        <telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" AllowPaging="true" AllowSorting="true" PageSize="5"
          runat="server" EnableLinqExpressions="false" OnNeedDataSource="RadGrid1_NeedDataSource">
        </telerik:RadGrid>
      </div>
    </telerik:RadAjaxPanel>
  </div>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance