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

GGC rows grouping

Thread ID:

Created:

Updated:

Platform:

Replies:

91705 Nov 29,2009 08:13 AM UTC Dec 1,2009 03:14 PM UTC WinForms 4
loading
Tags: GridControl
Arseny Khutoriansky
Asked On November 29, 2009 08:13 AM UTC


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)

Arseny Khutoriansky
Replied On 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

Rajadurai C [Syncfusion]
Replied On 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

Arseny Khutoriansky
Replied On 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.

Lingaraj S [Syncfusion]
Replied On 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.

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

;