Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET GridView in edit mode
    primarykey
    data
    text
    <p>I have a Gridview, that places two image icons for selecting and deleting a specific row. The grid is bound to a jquery datatable, but when I select the image to select the row, the default behaviour is to force a post back, which then causes the grid to loose the datable settings.</p> <p>Any idea how I retain the datatable on click of either button?</p> <pre><code>&lt;asp:GridView ID="grdMessageDups" runat="server" DataSourceID="sourceDuplicates" AutoGenerateColumns="false"&gt; &lt;Columns&gt; &lt;asp:CommandField ShowSelectButton="true" ButtonType="Image" SelectImageUrl="~/images/icn_alert_success.png"/&gt; &lt;asp:ButtonField ButtonType="Image" ImageUrl="~/images/icn_alert_error.png" /&gt; &lt;asp:BoundField DataField="MsgDateDetailDuplicatesID" Visible="false" /&gt; &lt;asp:BoundField DataField="1" HeaderText="Heading 1" /&gt; &lt;asp:BoundField DataField="2" HeaderText="Heading 2" /&gt; &lt;asp:BoundField DataField="3" HeaderText="Heading 3" /&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; </code></pre> <p>Then the DataTable JQuery stuff is:</p> <pre><code> var oTable = $('#grdMessageDetail').dataTable({ "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "ALL"]], 'asStripClasses': null, "iDisplayLength": 10, "bJQueryUI": true, "bFilter": true, "bAutoWidth": false, "bProcessing": true, "bServerSide": false, "sDom": 'RC&lt;"H"lfr&gt;t&lt;"F"ip&gt;', //Scrolling ....... "sScrollY": "250px", "sScrollX": "100%", "sScrollXInner": "100%", "bScrollCollapse": true, }); </code></pre> <p>The code in the code behind is:</p> <pre><code>public static void MakeAccessible(GridView grid) { if (grid.Rows.Count &lt;= 0) return; grid.UseAccessibleHeader = true; grid.HeaderRow.TableSection = TableRowSection.TableHeader; if (grid.ShowFooter) grid.FooterRow.TableSection = TableRowSection.TableFooter; } protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); MakeAccessible(grdMessageDups); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload