In this article, we want to discuss how to merge GridView with equal values. Before we get started, if you want to know about split with any delimited string, please go through the following article: Call JavaScript function from code behind in C#.

There are a lot of methods on the Internet solving the problem of how to merge GridView rows if neighboring cells show equal values. My approach is not the first; however, I think, it is rather universal and very short – less than 20 lines of code.

The last action is to add an OnPreRender event handler for the GridView:
Merge GridView Cells With Equal Values

Leave a Comment