Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

FileExplorer / Filter TextBox

  •  Images
    •  AllImages
    •  Customers
    •  Products
  
  
  
  
  
  
Page 1 of 2
Page 1 of 2. Items 1 to 6 of 7
Clear log Event log:

  • Filter TextBox

    RadFileExplorer supports filtering of the files and folders in the Grid. Simply set the EnableFilterTextBox property to true and a search box will be rendered above the Grid's header. The items are filtered on every key stroke, so you don't need to press "Enter" to invoke the filtering process. Note that the FileExplorer searches for the keyword in the currently selected directory, omitting the items in the subfolders.

    The text of the Label is set through the localizable FilterTextBoxLabel property.

    It is not necessary to have the built-in filter textbox enabled in order to perform filtering. The FileExplorer's filter(keyWord) client-side method can be used to filter the items in the currently selected directory.

    The filter client-side event (OnClientFilter property) is raised before the filtering occurs, and event argument object with the following properties and methods is passed to the event handler method:

    • get_text() - gets the text (keyword) to search for
    • set_text(newText) - sets the text (keyword) to search for
    • set_cancel(toCancel) - sets bool value that determines whether the filtering will be cancelled - set_cancel(true) will cancel the filtering process.
    • get_domEvent() - gets a reference to the current domEvent - it comes handy when you need to determine which key was pressed

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.Web.Examples.FileExplorer.FilterTextbox.DefaultCS" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <qsf:HeadTag runat="server" ID="Headtag1"></qsf:HeadTag>
    </head>
    <body class="BODY">
        <form id="form1" runat="server">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="c#" />
        <telerik:RadScriptManager ID="ScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //<![CDATA[
            function OnClientFilter(sender, eventArgs)
            {
                logEvent("Filter event: The user searched for <strong>\"" + eventArgs.get_text() + "\"</strong> keyword.");
            }
            //]]>
        </script>
        <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server"></telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxPanel ID="AjaxPanel1" runat="server" LoadingPanelID="LoadingPanel1" Height="350px" Style="padding-top: 20px;">
            <div style="float: left; width: 550px; height: 350px;">
                <telerik:RadFileExplorer runat="server" ID="FileExplorer1" Width="520px" Height="320px"
                    AllowPaging="true" PageSize="6" EnableFilterTextBox="true" OnClientFilter="OnClientFilter">
                    <Configuration ViewPaths="~/FileExplorer/ExplorerSource/Images" />
                </telerik:RadFileExplorer>
            </div>
            <qsf:ConfiguratorPanel ID="configFE" runat="server" Width="300px" Height="200px"
                Style="float: left;" Expanded="true">
                <div style="padding: 0 0 0 30px;">
                    <span></span>
                    <telerik:RadButton ID="chkEnableFilterBox" runat="server" Text="EnableFilterTextBox"
                        ButtonType="ToggleButton" ToggleType="CheckBox" OnCheckedChanged="btnSetText_CheckedChanged">
                    </telerik:RadButton>
                    <br />
                    <br />
                    <asp:TextBox ID="txtFilterLabel" runat="server" Style="margin-bottom: 7px;" />
                    <br />
                    <telerik:RadButton ID="btnSetText" runat="server" Text="Set Filter Label" OnClick="btnSetText_Click">
                    </telerik:RadButton>
                </div>
            </qsf:ConfiguratorPanel>
        </telerik:RadAjaxPanel>
        <qsf:EventLogConsole ID="eventLog" AllowClear="true" runat="server" Width="520px"
            Style="clear: both;" />
        <qsf:Footer runat="server" ID="Footer1" />
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451