Empty gridview

Empty gridview

wijwijwijwij Posts: 54Questions: 12Answers: 0

Hi,

I appreciate your time to help me with this issue.

I am using the data table editor for the asp.net framework. I have it applied on grid view that receives data from SQL.

It rendered beautifully except when there is no data, the whole page crashes
I tried adding <EmptyDataTemplate>There is no packagings data to browse!</EmptyDataTemplate> in the grdivew but it does not work
Once again, thank you for reading my post

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,374Questions: 26Answers: 4,957

    What are you returning when there is an empty data set? Datatables will work with an empty array, ie, [].

    Kevin

  • wijwijwijwij Posts: 54Questions: 12Answers: 0

    I return nothing.
    I usually use my code-behind to populate the grid view with data from the SQL table
    Can you elaborate more, please?

  • kthorngrenkthorngren Posts: 21,374Questions: 26Answers: 4,957
    Answer ✓

    It rendered beautifully except when there is no data, the whole page crashes

    Do you get errors? What exactly happens?

    I usually use my code-behind to populate the grid view with data from the SQL table

    Does this mean you are populating the DOM directly? What do you do with an empty table?

    Here is an empty DOM sourced table:
    http://live.datatables.net/vijaxosa/1/edit

    Is this what you are expecting?

    Use /language.emptyTable to change the string displayed.

    If this doesn't help please provide a link to your page or a test case showing the issue so we can help debug.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • wijwijwijwij Posts: 54Questions: 12Answers: 0

    Thank you Kthorngren for taking the time to reply back :)
    Yes, this is what I need to see
    live.datatables.net/vijaxosa/1/edit

    I will try to dig deeper
    Thanks a lot :-)

This discussion has been closed.