DataTables Search functionality not working for editable row in asp.net gridview
DataTables Search functionality not working for editable row in asp.net gridview
rathnamvemula
Posts: 2Questions: 1Answers: 0
I have a ASP.NET Gridview, which works fine when the grid is initially displayed.
When I Search for some value, it filters properly. After clicking Edit on the filtered row, the grid is not displaying any records.
This is happening if the value being searched is converted to TextBox after clicking Edit.
This discussion has been closed.
Answers
Per the forum rules please link to a test case showing the issue.
Here is the example.
ASP.NET Gridview (Sample Data):
Edit | EmployeeID | Name
Edit | 101 | Rahul
Edit | 102 | Rakesh
When I search for Rahul in the Search box, it filters and displays one row.
If I click Edit link after filtering, I see the empty grid instead of showing the editable row with the Name field in text box (In EditItemTemplate)
After clearing the text in the Search box, I can see the entire grid with the Name field converted to textbox.
Finally,If the field being searched is in textbox, the grid is not filtering the record.
The source code :
$("#<%=gv.ClientID%>").dataTable({
"aaSorting": [], //Remove all initial sorting (prevents the edit column being sorted initially).
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [0] }//dont allow the first column to be sortable on clicking the header.
],
"bStateSave": true,
"bAutoWidth": false
});