Filter RadGrid on external textbox key press

Thread is closed for posting
1 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 19 Jun 2007 Link to this post

    Requirements

    RadGrid for ASP .NET version

    RadControls for ASP .NET AJAX version

    4.x and later


    2008.1.415 and later

    .NET version

    2.0 and later

    Visual Studio version

    2005 and later

    Programming language

    C#, Javascript

    Browser support

    all supported by RadGrid for ASP .NET


    all browsers supported by RadControls for ASP .NET AJAX



    PROJECT DESCRIPTION


    This example illustrates how to filter the records in RadGrid on key press from a textbox outside of the grid. The operation is executed with asynchronous request started from the onkeyup handler of the textbox control. The value entered in the input is added to the WHERE clause of the SELECT statement which fetches the data from the underlying grid source.


      
                <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
                    <script type="text/javascript">  
                    var timer = null;  
     
                    function KeyUp()  
                    {  
                        if (timer != null)   
                        {  
                          clearTimeout(timer);  
                        }  
                        timer = setTimeout(LoadTable,500);  
                    }  
     
                    function LoadTable()  
                    {  
                         $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("FilterGrid");  
                    }  
                    </script>  
                </telerik:RadCodeBlock> 




         <script type="text/javascript">     
            var timer = null;     
        
            function KeyUp()     
            {     
                if (timer != null)      
                {     
                  clearTimeout(timer);     
                }     
                timer = setTimeout(LoadTable,500);     
            }     
        
            function LoadTable()     
            {     
                    window["<%= RadGrid1.ClientID %>"].AjaxRequest("<%= RadGrid1.UniqueID %>","FilterGrid");     
            }     
          </script>    
     
Back to Top