I need to display data in grid view with merged rows for some columns. Please help me to prepare a grid view in below defined format:
And the original data comes from database is in below format:
Please help me to find best way for doing this task dynamically and efficiently.
You will have to use
RowSpan
.Refer following code for it:
Referance:
https://sites.google.com/site/learning6329/asp-net/gridview-merge-cells
Pictorial Example As In Question:
http://marss.co.ua/MergingCellsInGridView.aspx
Simplest way to merge Row-cells of first column is as below. Please note that For Loop is always to be iterated in reverse.
If you want to merge row-cells of all columns similarly, you can use another "forloop" within outer forloop written above