Hi Henrick,
Thanks for your update.
You have used the right way to achieve your scenario and you can get the column indent count using GetColumnIndentCount method. Also, we have prepared the sample based on your requirement please refer to the below code example and the below sample,
Code example
this.gridGroupingControl1.Table.GroupExpanded += new GroupEventHandler(Table_GroupExpanded);
void Table_GroupExpanded(object sender, GroupEventArgs e)
{
int mergeCellCount = 6;
for (int i = 0; i < this.gridGroupingControl1.Table.Elements.Count; i++)
{
if (this.gridGroupingControl1.Table.Elements[i] is GridRecordRow)
{
GridRecordRow row = this.gridGroupingControl1.Table.Elements[i] as GridRecordRow;
int indentCount = this.gridGroupingControl1.TableDescriptor.GetColumnIndentCount();
int colindex1 = this.gridGroupingControl1.TableModel.NameToColIndex("Project");
int colindex2 = this.gridGroupingControl1.TableModel.NameToColIndex("MergeCol1");
int colindex3 = this.gridGroupingControl1.TableModel.NameToColIndex("MergeCol2");
int colindex4 = this.gridGroupingControl1.TableModel.NameToColIndex("MergeCol3");
for (int j = 0; j < row.ParentGroup.Groups.Count; j++)
{
int toprowindex = row.ParentGroup.Groups[j].Records[0].GetRowIndex();
int count = row.ParentGroup.Groups[j].Records.Count;
int bottomIndex = row.ParentGroup.Groups[j].Records[count - 1].GetRowIndex();
int splitcount = count / mergeCellCount;
for (int k = 0; k < splitcount; k++)
{
int topindex = toprowindex + (k * mergeCellCount);
int bottomindex = topindex - 1 + mergeCellCount;
this.gridGroupingControl1.TableModel.CoveredRanges.Add(GridRangeInfo.Cells(topindex, colindex1, bottomindex, colindex1));
this.gridGroupingControl1.TableModel.CoveredRanges.Add(GridRangeInfo.Cells(topindex, colindex2, bottomindex, colindex2));
this.gridGroupingControl1.TableModel.CoveredRanges.Add(GridRangeInfo.Cells(topindex, colindex3, bottomindex, colindex3));
this.gridGroupingControl1.TableModel.CoveredRanges.Add(GridRangeInfo.Cells(topindex, colindex4, bottomindex, colindex4));
}
}
}
}
}
Sample link: GridGroupingControl
Any way we are glad to know that your reported problem has resolved.
Please let us know if you have any further assistance on this.
Regards,
Mohanraj G