RealGrid2 Guide
Column
Merge cells horizontally

Callback for custom span

You can use layout.spanCallback to merge cells horizontally.

You can apply spanCallback to a specific column and use it dynamically or apply it to all rows at once. When used dynamically, internal conditions must be set directly, and cells are merged horizontally as much as the returned value. At this time, the data from the first cell being merged is output. (Values cannot be output by calculating or combining them with the values of other fields being merged.)

gridView.layoutByColumn("KorName").spanCallback = function (grid, layout, itemIndex) {
     var value = grid.getValue(itemIndex, "Gender")
     if(value == "Male"){
         return 2; //Number of horizontal merges
     }
    
     return 1;
};