locked
Jquery Datatable RRS feed

  • Question

  • User-1499457942 posted

    Hi

       I have Gridview enclosed in Jquery Datatable . I want if there is no record in Gridiview Then No record found should get displayed.

    Thanks

    Sunday, September 23, 2018 10:11 AM

Answers

  • User61956409 posted

    Hi JagjitSingh,

    if there is no record in Gridiview Then No record found should get displayed

    To achieve your requirement: displaying Empty (No records found) message in GridView when no data, you can use EmptyDataTemplate in your GridView. The following sample code is for your reference.

    <asp:GridView ID="GridView1" runat="server" CssClass="Grid" AutoGenerateColumns="false" ShowHeaderWhenEmpty="true">
        <Columns>
            <asp:BoundField DataField="Id" HeaderText="Id" />
            <asp:BoundField DataField="Name" HeaderText="Name" />
        </Columns>
        <EmptyDataTemplate>
            <div style="text-align: center">No records found.</div>
        </EmptyDataTemplate>
    </asp:GridView>

    Test result:

    With Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 24, 2018 2:03 AM