Error when using image with datatable

Error when using image with datatable

RawadRawad Posts: 3Questions: 3Answers: 0

Dear I have the below code
<asp:GridView ID="gvCustomers" runat="server" OnRowDataBound="gvCustomers_RowDataBound" AutoGenerateColumns="False" class="table table-striped"
Width="100%" >
<Columns>
<asp:BoundField DataField="DORMARSOUM" HeaderText="Marsoum" />
<asp:BoundField DataField="DORCAZA" HeaderText="Caza" />
<asp:BoundField DataField="DORROAD" HeaderText="Road" />
<asp:BoundField DataField="DORMARSOUM" HeaderText="Marsoum" />
<asp:BoundField DataField="DORCAZA" HeaderText="Caza" />
<asp:BoundField DataField="DORROAD" HeaderText="Road" />
<asp:TemplateField>
<ItemTemplate>
<asp:Image ID="Image1" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

in the code behind, am applying condition to set the image
but am getting the following error

localhost says:
Datatables warning:Non -Table node initialisation(IMG).For more information about this error, please see http://datatables.net/tn/2

can somebody help

Answers

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947

    I'm not sure what your code is generating but did you follow the troubleshooting link in the message?
    https://datatables.net/manual/tech-notes/2

    You should inspect your resulting HTML. Looks like you might have something like this to init Datatables: $('#Image1').DataTable()

    Kevin

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    You are being directed to a page which shows the explanation:

    DataTables will initialise only on an HTML table element. Running DataTables on any other element type will result in an error.

    You don't have a HTML table in your code.

This discussion has been closed.