Filtering on Radgrid on Client Side

2 posts, 0 answers
  1. Chintan
    Chintan avatar
    1 posts
    Member since:
    Sep 2014

    Posted 01 Sep Link to this post

    Hello Team,

    I am having  simple Radgrid. which I am binding with JSON object  like below :

    $(document).ready(function () {
                $(window).load(function () {
                    var JSONdata = [{ "ID": 1, "FirstName": "Chintan", "MiddleName": "Mukesh", "SurName": "Dave" }, { "ID": 2, "FirstName": "Pratik", "MiddleName": "Mukesh", "SurName": "Dave" }, { "ID": 3, "FirstName": "Devang", "MiddleName": "Subhash", "SurName": "Trivedi" }]
                    var tableView = $find("<%=form1.FindControl("gridClientSide").ClientID%>").get_masterTableView();

    Grid Code :

    <telerik:RadGrid  ID="gridClientSide" runat="server" AutoGenerateColumns="false" AllowFilteringByColumn="true">
                    <MasterTableView TableLayout="fixed">
                            <telerik:GridBoundColumn DataField="ID" HeaderText="ID" AllowFiltering="true" UniqueName="ID"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" AllowFiltering="true"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="MiddleName" HeaderText="Middle Name" AllowFiltering="true" ></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="SurName" HeaderText="Sur Name" AllowFiltering="true"></telerik:GridBoundColumn>
                        <ClientEvents OnCommand="RaiseCommand"/>

    function RaiseCommand(sender, args) {

                sender.get_masterTableView().filter(sender.get_masterTableView().get_filterExpressions().getItem(0).FieldName, sender.get_masterTableView().get_filterExpressions().getItem(0).FieldValue, sender.get_masterTableView().get_filterExpressions().getItem(0).FilterFunction, true);



    In RaiseCommand function ,  I am trying to filter radgrid by setting  filter expression nothing error occurs but no change applies in rows of grid after execution of this function.


    Please help....Please find attached filed

  2. Konstantin Dikov
    Konstantin Dikov avatar
    1753 posts

    Posted 06 Sep Link to this post

    Hello Chintan,

    The approach that you are trying to use will not work, because such data operations are not supported with such binding. Furthermore, you are calling the filter method of the masterTableView, which will fire in an endless loop the OnCommand event of the RadGrid. I would recommend that you take a look at the implementation in the following online demo, where the data is provided to the RadGrid after each operation:
    You could also take a look at the RadClientDataSource integration:

    Konstantin Dikov
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft R3 2016 release webinar banner
Back to Top