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

Filtering DataSourceControl with RadFilter

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

ContactNameCityAddressBool
adddddddh  
agbaaaaaa  
aadwadawd  
whattttt  

RadFilter can be used to build complex filtering criteria by means of intuitive visual UI and depending on the data type of the underlying source fields. This example demonstrates the integration between RadFilter and .Net 3.5/4.0 DataSourceControls such as LinqDataSource, EntityDataSource and OpenAccessDataSource.

To filter the .NET 35/.NET 4 data source control directly, you need to specify the DataSourceControlID property of RadFilter.

  • defaultvb.aspx
  • defaultvb.aspx.vb
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="defaultvb.aspx.vb" Inherits="Telerik.FilterExamplesCSharp.DataSourceIntegration.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" />
    <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1"></telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel2" LoadingPanelID="RadAjaxLoadingPanel1" CssClass="demo-container size-narrow">
        <div class="FilterContainer">
            <telerik:RadFilter RenderMode="Lightweight" runat="server" ID="RadFilter1" DataSourceControlID="EntityDataSourceCustomers"
                OnApplyExpressions="RadFilter1_ApplyExpressions">
            </telerik:RadFilter>
            <asp:EntityDataSource ID="EntityDataSourceCustomers" runat="server" ConnectionString="name=NorthwindReadWriteEntities"
                DefaultContainerName="NorthwindReadWriteEntities" EntitySetName="Customers" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True">
            </asp:EntityDataSource>
        </div>
        <br />
        <asp:GridView runat="server" ID="GridView1" AllowPaging="true" AllowSorting="true"
            DataSourceID="EntityDataSourceCustomers" AutoGenerateColumns="false">
            <EmptyDataTemplate>
                No recrods to display.
            </EmptyDataTemplate>
            <Columns>
                <asp:BoundField DataField="ContactName" HeaderText="ContactName" SortExpression="ContactName" />
                <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
                <asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
                <asp:CheckBoxField DataField="Bool" HeaderText="Bool" SortExpression="Bool" />
            </Columns>
        </asp:GridView>
    </telerik:RadAjaxPanel>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance