Skip to content Skip to sidebar Skip to footer

Jquery Datatable Lost After Selected Index Change Dropdownlist Asp.net Update Panel

i have added jquery library to my gridview and it was really helpfull. when on page load this datatable show perfectly, but when I change value of dropdown list jquery datatable di

Solution 1:

You have to rebind your datatable after postback. It happens now only during load. After every postback rebind the table

This is probably what you are searching for

pageLoad() will be triggered after every postback

functionpageLoad() { 
         bindGrid();
};

functionbindGrid(){
      $('[id*=GridView1]').prepend($("<thead></thead>").append($(this).find("tr:first"))).DataTable({
      "responsive": true,
      "sPaginationType": "full_numbers"
   });
};

it does require to be on page.

<asp:ScriptManagerrunat="server" />

A other option instead of pageload is

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(bindGrid);

Post a Comment for "Jquery Datatable Lost After Selected Index Change Dropdownlist Asp.net Update Panel"