We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

merging cells at different rows and columns

Thread ID:





67076 Aug 8,2007 11:29 AM UTC Aug 9,2007 07:25 AM UTC WinForms 1
Tags: Grouping
Asked On August 8, 2007 11:29 AM UTC

I am using grid grouping,and I need to merge two cells at different row and at different columns.
I have five colums c1,c2,c3,c4,c5 and 10 rows from r1-r10.
Now at row no r1 I need to merge c1 and c2 showing only c1 content but c3,c4,c5 will be showing there content.similarly at row r3 I need to merge c3 and c4 showing c3 content,rest of the colums will be showing there content.This coulld happen at any row and any columns depending on the no of columns.At the same time I need to format the content and font of the cells.

Jeba S [Syncfusion]
Replied On August 9, 2007 07:25 AM UTC

Hi ejaz,

Thank you for your details.

You can use the CoveredCells collection in the grid to merge cells at different rows and columns by passing the Cells/Cell, Cols/Col

and Rows/Row in GridRangeInfo.

Please refer this code snippets:

this.gridGroupingControl1.TableModel.CoveredRanges.Add(GridRangeInfo.Cells(4, 1, 4, 2));
this.gridGroupingControl1.TableModel.CoveredRanges.Add(GridRangeInfo.Cells(6, 3, 6, 4));

You can format the covered cells by handling the QueryCellStyleInfo event and set the required styles.

void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
if ((e.TableCellIdentity.RowIndex == 4 && e.TableCellIdentity.ColIndex == 1)
||(e.TableCellIdentity.RowIndex == 6 && e.TableCellIdentity.ColIndex == 3))
e.Style.Font.Bold = true;
e.Style.Font.Facename = "Arial";
e.Style.Font.Size = 12;
e.Style.BackColor = Color.Pink;

Please refer the sample which illustrates the above said feature:

Thank you for using Syncfusion Products.

Best Regards,


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon