Merge cells

Hi,

I am using GroupingGrid in windows application.
I need to merge two columns - column 8 and 9. How do I do that?
Column 8 is a push button and 9 is a static.
I tried the code below:
GridColumnSpanDescriptor d2 = new GridColumnSpanDescriptor("Exemption", "C8:C9");
GridColumnSpanDescriptor d3 = new GridColumnSpanDescriptor("Exemption1", "C8:C9");
gridColumnSetDescriptor1.ColumnSpans.AddRange(new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor[] {
d2, d3});
this.m_GridControl.TableDescriptor.ColumnSets.AddRange(new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSetDescriptor[] {
gridColumnSetDescriptor1});

How do I do this?
Thanks.

1 Reply

JJ Jisha Joy Syncfusion Team September 29, 2009 12:08 PM UTC

Hi Shilvana,

Thank you for your interest in Syncfusion Proucts.

If your intension is to implement multirow records in GridGroupingControl by using GridColumnSpanDescriptor and GridColumnSetDescriptor classes, this can be achieved by the following code:

Here is the code:


Dim csd1 As GridColumnSpanDescriptor = New GridColumnSpanDescriptor("Criteria", GridRangeInfo.Cells(0, 0, 0, 1).ToString())
Dim csd2 As GridColumnSpanDescriptor = New GridColumnSpanDescriptor("Criteria Value", GridRangeInfo.Cells(1, 0, 1, 0).ToString())
Dim csd3 As GridColumnSpanDescriptor = New GridColumnSpanDescriptor("History", GridRangeInfo.Cells(1, 1, 1, 1).ToString())
Dim csd As GridColumnSetDescriptor = New GridColumnSetDescriptor()
csd.ColumnSpans.Add(csd1)
csd.ColumnSpans.Add(csd2)
csd.ColumnSpans.Add(csd3)
Me.GridGroupingControl1.TableDescriptor.ColumnSets.Add(csd)


Please refer the minimal sample:

SampleLink'>http://websamples.syncfusion.com/samples/Grid.Windows/43195/main.htm">SampleLink

Kindly let me know if this helps.

Regards,
Jisha

Loader.
Up arrow icon