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.
Unfortunately, activation email could not send to your email. Please try again.

GridGroupingControl - Merging Cells

Thread ID:

Created:

Updated:

Platform:

Replies:

48762 Sep 4,2006 09:46 AM Sep 7,2006 07:07 AM Windows Forms 6
loading
Tags: GridControl
Badri Rajani Kanth
Asked On September 4, 2006 09:46 AM

Hi,

We are working with GGC v 3.2.1.0.

I want to merge a column in all rows. Say if a column A has string data d1, d2, d3 in rows r1, r2 and r3. I want to merge all A column cells and display concatenated data as "d1. d2. d3".

I am trying using MergeCellsMode = GridMergeCellsMode.OnDemandCalculation|GridMergeCellsMode.MergeRowsInColumn; AND Column A.MergeCell = GridMergeCellDirection.RowsInColumn;

But I couldn''t get it.

Otherwise, is it possible to merge all columns (column Name A), but display data of first column alone? Assumung that I get data "d1. d2. d3" in first row only.

Thanks and Regards
Rajani Kanth

Administrator [Syncfusion]
Replied On September 5, 2006 04:44 AM

Hi Rajani,

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 QueryCoveredRange event in the Grid to do this.

private void gridGroupingControl1_QueryCoveredRange(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableQueryCoveredRangeEventArgs e)
{
if (e.RowIndex < e.Table.DisplayElements.Count)
{
Element el = e.Table.DisplayElements[e.RowIndex];
if(el.Kind == DisplayElementKind.Record)
{
if(e.ColIndex == 1 )
{
int start = e.Table.Elements.IndexOf( e.Table.Records[0] );
e.Range = GridRangeInfo.Cells(start, e.ColIndex, start+ e.Table.Records.Count - 1,e.ColIndex);
e.Handled = true;
}
}
}
}

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.

//Merge Cell based on the cell content.
this.gridGroupingControl1.TableModel.Options.MergeCellsMode = GridMergeCellsMode.OnDemandCalculation|GridMergeCellsMode.MergeRowsInColumn;
this.gridGroupingControl1.TableDescriptor.Columns["A"].Appearance.AnyRecordFieldCell.MergeCell = GridMergeCellDirection.RowsInColumn;

Here is a sample project showing how this is done.
http://www.syncfusion.com/Support/user/uploads/GGC_MergeColumn_16d12ff9.zip

Let us know if you need more information on this.

Regards,
Haneef

Badri Rajani Kanth
Replied On September 5, 2006 05:28 AM

Hi Haneef,

I tried with merging earlier.

this.gridGroupingControl1.TableModel.Options.MergeCellsMode = GridMergeCellsMode.OnDemandCalculation|GridMergeCellsMode.MergeRowsInColumn;
this.gridGroupingControl1.TableDescriptor.Columns["A"].Appearance.AnyRecordFieldCell.MergeCell = GridMergeCellDirection.RowsInColumn;

This code is not merging even in your sample .I made dr[0] = "data"; and commented QueryCoveredRange and QueryCellStyleInfo events.

But duplicate data is not merged. Can you please tell me if there is any other property also?

Rgds
Rajani Kanth

Badri Rajani Kanth
Replied On September 6, 2006 04:19 AM

Hi Haneef,

Any Input on this plz..

Rgds
Rajani Kanth

Administrator [Syncfusion]
Replied On September 6, 2006 05:46 AM

Hi Rajani,

We regret for the inconvenience caused.

I am able to see this issue in version 3.2 and it is now fixed in our latest release version 4.2 (v4.2.0.37). Here is the download link:

http://www.syncfusion.com/Downloads/latestversion.aspx


Please install this version and let me know if you see any problems.

Thanks for using Syncfusion products.

Best Regards,
Haneef

Badri Rajani Kanth
Replied On September 6, 2006 06:50 AM

Thank You Haneef,

But we and our client are using V 3.2.1.0 only. So, i have to check if we can upgrade to latest version.

Earlier also we had an issue like this, where we updated our application with fixed DLL. Plz see..
https://www.syncfusion.com/Support/DirectTrac/user/details.aspx?id=24209

Now also, is it possible for you to give the fixed dll of v.3.201.1.1. This dll should be compiled with all other dependent references point to v.3.201.1.0.

Rgds
Rajani Kanth

Administrator [Syncfusion]
Replied On September 7, 2006 07:07 AM

Hi Rajani,

Thanks for being patience.

Please open a D-Trac incident to have further details and for the answer on this issue. For more details on opening a new D-Trac incident, please contact our sales team ( sales@syncfusion.com ).

Thanks,
Madhan

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.

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.

;