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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

merge cells

Thread ID:

Created:

Updated:

Platform:

Replies:

50026 Oct 3,2006 08:47 PM UTC Oct 4,2006 04:37 AM UTC WinForms 1
loading
Tags: GridControl
Hui Zhong
Asked On October 3, 2006 08:47 PM UTC

Hi

I have one question on the grid merge cell feature. Please take a look at the spreadsheet attached. I want all the rows merged for the column A. However, for the column B, the merge just apply based on the column A merged range.
So the B2:B3 is merged in one cell, B4:B8 is merged in one cell, thought B2:B8 have the same value. We use the virtual grid. Can it be implmented in essential grid?

Regards,
Hui

mergecellTest.zip

Administrator [Syncfusion]
Replied On October 4, 2006 04:37 AM UTC

Hi Hui,

The VirtualMergeCell browser sample demonstrates the dynamic merge cells. It uses the derived GridControl and the GridModel to handle this task. For more static merge cells, all you have to do, is to the properties that are shown below while going through the work of the deriving classes to override methods in order to implement dynamic merging.

MergeCells refer to the combining of cells which, have either the same values or the same styles. The sample shows you how to merge cells with like values dynamically. The sample fills the first three columns with virtual data in the OnQueryCellInfo. The grid checks which, cells are repeating (OnQueryCanMergeCells determines if cells are to be treated equal) and automatically merges them on demand. You can enable merging rows within a column with.

grid.Model.Options.MergeCellsMode = GridMergeCellsMode.OnDemandCalculation|GridMergeCellsMode.MergeRowsInColumn;

Then you can specify the merge behavior for individual cells. To make merging the default for all cells do this.

GridStyleInfo standardStyle = BaseStylesMap["Standard"].StyleInfo;
standardStyle.MergeCell = GridMergeCellDirection.RowsInColumn;

GridStyleInfo rowHeaderStyle = BaseStylesMap["Row Header"].StyleInfo;
rowHeaderStyle.MergeCell = GridMergeCellDirection.RowsInColumn;

In The VirtualMergeCell browser sample we are filling the first three columns with virtual data in the OnQueryCellInfo. The grid checks which, cells are repeating (OnQueryCanMergeCells determines if cells are to be treated equal) and automatically merges them on demand.Changes in the columns are ignored since the value is always calculated in the OnQueryCellInfo. The other columns are regular cells where you can enter data and save them in the regular grid data object. When you enter the same value in neighboring cells in the same column they will automatically merge. When one value is changed then, they will automatically un-merge. Please refer the MergeCell Browser sample for more details. Below is a path

\Syncfusion\Essential Studio\4.3.0.25\windows\Grid.Windows\Samples\Quick Start\VirtualMergeCell\cs

Thanks,
Haneef

CONFIRMATION

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.

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

;