Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
in my view i have dropdownlist and telerik grid, based on dropdownlist selected value data is bind to the grid, if dropdownlist selected value changes iam using grid rebind function to display data in grid using javascript, grid displays data fine , but filter is not working after grid rebind function,if i click the filter data not displaying.
plz help me to find the solution iam struggling from last 3 days to find this out.

here is my view code
SQL
  @{

            Html.Telerik().Grid<TicketOven.Model.EventTicketsModel>()
            .Name("GridName")
            .OrderBy(sortOrder => sortOrder.Add(c => c.SNO).Ascending()))
             .DataKeys(datakeys => datakeys.Add(item => item.SNO))

            .Columns(column =>
            {

                column.Bound(item => item.CategoryName).Title("Category");
                column.Bound(item => item.TicketPrice).Title("Price").Filterable(true);
                column.Bound(item => item.IsTicketValidated).Title("ValidatedStatus")
                   .ClientTemplate("<#= IsTicketValidated? 'Yes' : 'No' #>");


            })
            .NoRecordsTemplate("No records available")
            .DataBinding(binding => binding.Ajax().Select("EventGridACtion", "Home"))
            .Filterable()
            .Filterable(filtering => filtering.Enabled(true))
            .Render();
        }


here is my javascript function on dropdown change event:

     <script type="text/javascript">
         $("#dropdownid ").change(function () {
          var selectedvalue= $("#dropdownid option:selected").val();
            var grid = $("#GridName").data("tGrid");
            grid.rebind({ selectedvalue: selectedvalue});
           });
        </script>
Posted
Updated 19-Jun-13 6:30am
v2
Comments
saguptamca 19-Jun-13 10:40am    
place alert between java script statements and chk the values, if they correct or not
dorababu407 19-Jun-13 11:03am    
hi saguptamca, thks for rply

i checked the values are correct, data binding is fine, but filter of my last column(IsTicketValidated) not working after grid rebinding.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900