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

GGC rows grouping


I use GGC.

I have a few tables in DataBase in the following format:

ID1 | ID2 | ID3 | Val
---------------------
1 | 1 | 1 | a
---------------------
1 | 1 | 2 | b
---------------------
1 | 2 | 1 | c
---------------------
2 | 1 | 1 | d
---------------------
2 | 1 | 2 | f
---------------------
2 | 1 | 3 | g
---------------------

And I want to dysplay it as follow:

ID1 | ID2 | ID3 | Val
---------------------
| | 1 | a
| 1 |----------
1 | | 2 | b
|----------------
| 2 | 1 | c
---------------------
| | 1 | d
| |----------
2 | 1 | 2 | f
| |----------
| | 3 | g
---------------------

How do I do it? (without using Grouping, I need flat table)

4 Replies

AK Arseny Khutoriansky November 29, 2009 08:25 AM UTC

Unfortunately, all tables were deformed, because of gaps in the text.
Please see the attached pic.



syncf_a65e3b7d.rar


RC Rajadurai C Syncfusion Team November 30, 2009 04:27 PM UTC

Hi Arsenii,

Thanks for your interest in Syncfusion Products.

The appearance mentioned in your update can be achieved in GridGroupingControl with flat table by means of handling QueryCoveredRange event. Here is the code for your reference.

if (e.RowIndex > 2)
{
if (e.ColIndex == 1 && e.RowIndex % 3 == 0)
e.Range = GridRangeInfo.Cells(e.RowIndex, e.ColIndex, e.RowIndex + 2, e.ColIndex);
if (e.ColIndex == 2 && (e.RowIndex - 1) % 2 == 0)
e.Range = GridRangeInfo.Cells(e.RowIndex, e.ColIndex, e.RowIndex + 1, e.ColIndex);
e.Handled = true;
}

Here is a sample for your reference in which this has been implemented.
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=F91705-240140371.zip

Regards,
Rajadurai


AK Arseny Khutoriansky November 30, 2009 05:00 PM UTC

Rajadurai,

Thank you for your reply.
But this is not exactly what I need.

I want that all rows with the same ID1, should have a common cell in the first column. And in cell display value of ID1.
Rows with the same ID1 and ID2, should have a common cell in the second column. And in cell display value of ID2.

In other words, I want to group rows by ID1 and ID2, but show it as flat table.


LS Lingaraj S Syncfusion Team December 1, 2009 03:14 PM UTC

Hi Arsenii,

Thank you for the update.

If you want to merge the cells in GridGroupingControl based on cell value, then please try using the below settings in GridGroupingControl to achieve this functionality.


this.gridGroupingControl1.TableModel.Options.MergeCellsMode = GridMergeCellsMode.OnDemandCalculation | GridMergeCellsMode.MergeColumnsInRow | GridMergeCellsMode.MergeRowsInColumn;
this.gridGroupingControl1.TableDescriptor.Columns[0].Appearance.AnyRecordFieldCell.MergeCell = GridMergeCellDirection.Both;
this.gridGroupingControl1.TableDescriptor.Columns[1].Appearance.AnyRecordFieldCell.MergeCell = GridMergeCellDirection.Both;


Please let me know if you have any queries.

Regards,
Lingaraj S.

Loader.
Live Chat Icon For mobile
Up arrow icon