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. Image for the cookie policy date
close icon

Resize and Merge not playing nicely together

I have a merged cell across two rows and resize columns is turned on for the grid.

However when I hover over the middle of the merged cell the resize cursor appears making it impossible to click on the checkbox of my merged cell which is center aligned. There is no border in that location so why can I drag it?

Is there any way I can turn off the resize cursor for the middle of this merged cell?

Can I only allow resizing on certain columns as
if (e.Columns.Left % 2 == 1)
e.Cancel = true;
happens too late and the check box click has gone? Is there some pre-pre-resize event that I've missed?

Can you stop my head from spinning?

1 Reply

HA haneefm Syncfusion Team September 7, 2007 10:35 PM UTC

Hi Richard,

Here is a sample project that shows you "How to merge the cells in a grid and prevent the resizing cursor in a middle of the merged cells?. Please try this and let me know if this helps.
MergeCellsInGrid.zip

The grid actually has two ways to make a group of cells display as one large cell. The first technique is coverd cells where an explicit group of cells can be made to behave like a single cell. The second technique is merged cells where adjacent cells that hold duplicate values as group together so you only see the value once.

By merging cells, do you mean making a range of cells appear as a single cell. If so, you use the CoveredCells collection in the GridControl or GridDataBoundGrid to do this.

//cover (2,2) thru (4,5)
this.gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(2,2,4,5));

If you want to make adjacent cells that have the same values in them only show the value once, then you need to set one grid property, and then set a style property in the cells that you want to allow to merge.

this.gridControl1.Model.Options.MergeCellsMode = GridMergeCellsMode.OnDemandCalculation|GridMergeCellsMode.MergeRowsInColumn;
this.gridControl1.ColStyles[2].MergeCell = GridMergeCellDirection.RowsInColumn;

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon