Telerik skin

Filter - Filtering with RadFilter

  • And
  • Or
  • Not And
  • Not Or
  • Contains
  • DoesNotContain
  • StartsWith
  • EndsWith
  • EqualTo
  • NotEqualTo
  • GreaterThan
  • LessThan
  • GreaterThanOrEqualTo
  • LessThanOrEqualTo
  • Between
  • NotBetween
  • IsEmpty
  • NotIsEmpty
  • IsNull
  • NotIsNull
  • Title
  • Category Id
  • Parent Id

Page size:
 2UI for ASP.NET Ajax1
  4Included Controls2
   23Why Choose2
   24What's New2
   25System Requirements2
   26Online Demos2
   27Release History2
   31Download Trial2
   32Buy Now2
 33UI for WinForms1
  171Test Studio1
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

This demo illustrates how to filter RadTreeList bound to LinqDataSource using a RadFilter control.

For this purpose you need to handle the ApplyExpressions event and built up the sql query manually. There you should make sure the parent items to the root for the items fulfilling the filter criterion are returned as well. Otherwise, the filtered data set might have no any root items and as a result no records will be displayed.

The query used in this demo is universal and you can use it by replacing the columns' and the datatable's name.

  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • styles.css
<%@ Page Language="c#" Inherits="Telerik.TreeListExamplesCSharp.Integration.FilteringWithRadFilter.DefaultCS"CodeFile="DefaultCS.aspx.cs"  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
<html xmlns=''>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="stylesheet" />
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1" CssClass="demo-container">
        <div class="FilterContainer">
            <telerik:RadFilter RenderMode="Lightweight" runat="server" ID="RadFilter1" ExpressionPreviewPosition="Bottom" OnApplyExpressions="RadFilter1_ApplyExpressions">
                    <telerik:RadFilterTextFieldEditor FieldName="Title" DisplayName="Title"></telerik:RadFilterTextFieldEditor>
                    <telerik:RadFilterNumericFieldEditor FieldName="CategoryId" DisplayName="Category Id" DataType="System.Int32"></telerik:RadFilterNumericFieldEditor>
                    <telerik:RadFilterNumericFieldEditor FieldName="ParentId" DisplayName="Parent Id" DataType="System.Int32"></telerik:RadFilterNumericFieldEditor>
        <br />
        <br />
        <telerik:RadTreeList RenderMode="Lightweight" runat="server" ID="RadTreeList1" AllowSorting="true" AllowPaging="true" OnNeedDataSource="RadTreeList1_NeedDataSource" PageSize="20" DataKeyNames="CategoryId" ParentDataKeyNames="ParentId" AutoGenerateColumns="false">
                <telerik:TreeListBoundColumn DataField="CategoryId" UniqueName="CategoryId" HeaderText="CategoryId"></telerik:TreeListBoundColumn>
                <telerik:TreeListBoundColumn DataField="Title" UniqueName="Title" HeaderText="Title"></telerik:TreeListBoundColumn>
                <telerik:TreeListBoundColumn DataField="ParentId" UniqueName="ParentId" HeaderText="ParentId"></telerik:TreeListBoundColumn>

Support & Learning Resources

Find Assistance

Help Us Improve

Was this example helpful?