radzen-blazor
radzen-blazor copied to clipboard
RadzenDataGrid doesn't appear to do colspan/rowspan properly
Describe the bug I found this issue when I was trying to turn data from an Excel file into data to render via RadzenDataGrid, but decided to make some simple cases to test with.
From experimenting, I have made the following cases:
- Using only colspans (alongside single cells), everything renders correctly.
- Using only rowspans (alongside single cells), everything renders correctly BUT there was a missing grid line.
- Using a mixture of colspans and rowspans:
- In simple cases, there are sometimes cells being skipped over entirely and there are cases where cells are included when they shouldn't be, primarily it seems to be that all the cells that would make up the portions that are not the topmost row or the rightmost column of the full span are included when they shouldn't be.
- In the more elaborate cases, if there is a cell that has both colspan and rowspan, and then under that are multiple cells that are also colspan'd and rowspan'd within the same range as the first cell's colspan, then Radzen will throw an exception due to attempting to add an existing key to its internal dictionary of rowspans.
What I seem to gather from this:
- For the rowspan problem of missing a grid line, it seems that if you have a rowspan in the last column, the cells in the column just to the left of that and on the rows past the one where the rowspan started will not have their right border set properly in CSS, because they are being treated like the last cells in the row due to there being no cells to their right due to the rowspan.
- For the mixture problem of extra cells or throwing an exception, from trying to trace through the code in a debugger, it seems it might stem from Radzen changing its current column index due to colspan before it does anything about rowspan, but I cannot be sure what the actual solution is.
To Reproduce https://github.com/CyberBotX/RadzenDataGridSpanTest
The README.md of the above repo also explains the issues I mentioned above.
Expected behavior I expect all the cells that I define to be included (unless they would've been ignored due to colspan and/or rowspan), I except that all grid lines are included, I expect that there should be no exceptions due to having multiple colspan and/or rowspan cells in the same grid.
Screenshots I do not have any screenshots, but the examples in my reproduction repo include HTML tables that show what the output should look like.
Desktop
- OS: Windows 10 64-bit
- Browser: Firefox (although the issue is not browser specific, I also tried Chrome)
Should be solved with Release 4.33.1 - 2024-06-28
Sorry it took me over a month to get to this reply, but I just updated my Radzen in that test project above, to 5.0.6, but all the errors in my test project still exist. I tried with both .NET 7 (which was what the project was initially on) and .NET 8 (since .NET 7 is approaching EOL). There are still missing grid lines and missing cells and extra cells and exceptions happening. Every single one of my test cases in that test repo still happen. I also tested with the last 4.x version (4.34.4) as well as the version mentioned in the comment above (4.33.1), it still happens in those as well.