RadGrid Client Side filtering

3 posts, 0 answers
  1. Angel
    Angel avatar
    4 posts
    Member since:
    Apr 2011

    Posted 06 Apr 2011 Link to this post



    I have a Rad Grid control in my ASPX page,  then I bind this control (server side binding) to a data table that I get from a web service. I want to implement a client side filtering, but I don’t know how to do this or what things I need to change in order to do that. I think this is possible, because all the information I got, is now in client side (My table with all the rows.!! )


    I successfully implement server side filtering but this is very slow, so sadly this is not an option for me. :(


    Here’s a sample of my code (server side filtering):




    <telerik:RadGrid ID="gdOrders" AllowFilteringByColumn="True" runat="server" OnItemCommand="onItemCmd">
            <MasterTableView AllowFilteringByColumn="True">
                        <telerik:GridBoundColumn DataField="CSOL_FOLIOOTID" ShowFilterIcon="false" HeaderText="Folio"     UniqueName="CSOL_FOLIOOTID"  Resizable="False" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" AllowFiltering="true"  />




    //My binding (Loading function)

    myDataTable = myObjInstance.GetOrders();
    gdOrders.DataSource = myDataTable;

    protected void onItemCmd(object source, Telerik.Web.UI.GridCommandEventArgs e)
                  switch (e.CommandName)
                       case  RadGrid.FilterCommandName:
                          Pair filterPair = (Pair)e.CommandArgument;                      
                          TextBox filterBox = (e.Item as GridFilteringItem) [filterPair.Second.ToString()].Controls[0] as TextBox;
                          this.ApplyFilter((string)filterPair.Second, filterBox.Text);
     private void ApplyFilter(string clmnName, string value)
             string query = clmnName + " like '%" + value.Trim() + "%'";
             gdOrders.DataSource = myDataTable.Select(query);


    Can any one suggest me how to do this, what should I change or implement?


    Tnks :D



    Sorry for my English!!




  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 07 Apr 2011 Link to this post

    Hello Angel,

    You can consider using declarative client-side binding along with paging/sorting/filtering like in this online demo:
    Grid / Programmatic Binding

  3. DevCraft R3 2016 release webinar banner
  4. Angel
    Angel avatar
    4 posts
    Member since:
    Apr 2011

    Posted 14 Apr 2011 Link to this post

    Tnks all works fine :D   A dude, when my aspx calls a pagemethod, this is server side call nou ?  how this manage ajax or how it works?? 

    Tnks a lot ;)
Back to Top