Uncaught TypeError: Cannot set property '_DT_CellIndex' of undefined

Uncaught TypeError: Cannot set property '_DT_CellIndex' of undefined

stanley1271stanley1271 Posts: 4Questions: 2Answers: 0

I know this has been asked many times, but it seems that none of the solutions has worked for me. I am using C# and ASP.NET to build a page with several GridViews. The first three load fine with DataTables working as it should. However, I have one grid that just displays as it normally would without DataTables. Below is a link to the HTML output that seems to work fine in the DataTables test system. I get no error on this site, but locally I get the error "Uncaught TypeError: Cannot set property '_DT_CellIndex' of undefined". There are no other errors in JS or other code either.

http://live.datatables.net/bekoxozo/7/edit

This question has an accepted answers - jump to answer

Answers

  • stanley1271stanley1271 Posts: 4Questions: 2Answers: 0

    OK seems the issue is actually with the previous table that has no data in it, but displays properly. Now to figure out why that grid is throwing the error.

    http://live.datatables.net/tepuvafi/1/edit

  • stanley1271stanley1271 Posts: 4Questions: 2Answers: 0

    So it would seem that any ASP.NET GridView that is empty fails to work with DataTables. Any ideas on a fix? Workaround? If I cannot get this working on all grids, I have to move to another option.

  • allanallan Posts: 63,812Questions: 1Answers: 10,516 Site admin
    Answer ✓

    DataTables doesn't support colspan or rowspan in the table body I'm afraid. That's where the error is coming from. If there are no results for a table, just use a completely empty tbody. DataTables will show its "No records" message.

    Allan

This discussion has been closed.