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.

GGC: Grouped Row

Thread ID:

Created:

Updated:

Platform:

Replies:

68688 Sep 27,2007 06:58 AM Oct 4,2007 05:22 PM Windows Forms 4
loading
Tags: Grouping
Patrick Cheng
Asked On September 27, 2007 06:58 AM

Hi,

What I want to accomplish is to have a grouped row to contain data which maps to the columns just as the child rows do.

Right now, I just populate the row with a string of data, but I would like to have a cell populated which corresponds to the correct column. Also, when I move the column, this should be reflected in the grouped row as well as the child rows.

A similar trick is done in your RealTimeUpdates example, where you populate a cell in the grouped row, however, this was done through a summary descriptor, which means I cannot populate that row from a stream of data.

Could you please come up with a solution for me to accomplish this task. Thanks you.

Saravanan A [Syncfusion]
Replied On October 1, 2007 10:09 AM

Hi Patrick,

If your intension is to display any record values in the group caption, then first you would have to disable the covered range over the group caption. You can achieve this by setting the ShowCaptionSummaryCells property to true.

ggc.TopLevelGroupOptions.ShowCaptionSummaryCells = true;
ggc.ChildGroupOptions.ShowCaptionSummaryCells = true;

Then you would have to handle the QueryCellStyleInfo event and provide the corresponding cell values to those cells in group caption. Please try this and let us know if it helps you.

Regards,
Saravanan

Patrick Cheng
Replied On October 1, 2007 11:13 PM

Hi Saravanan,

Could you please provide an example with code snippets of how to handle the QueryCellStyleInfo event to accomplish this?

Many thanks!

>Hi Patrick,

If your intension is to display any record values in the group caption, then first you would have to disable the covered range over the group caption. You can achieve this by setting the ShowCaptionSummaryCells property to true.

ggc.TopLevelGroupOptions.ShowCaptionSummaryCells = true;
ggc.ChildGroupOptions.ShowCaptionSummaryCells = true;

Then you would have to handle the QueryCellStyleInfo event and provide the corresponding cell values to those cells in group caption. Please try this and let us know if it helps you.

Regards,
Saravanan

Patrick Cheng
Replied On October 3, 2007 10:46 PM

Hi Saravanan,

Any update with the examples? Thanks in advance!

>Hi Saravanan,

Could you please provide an example with code snippets of how to handle the QueryCellStyleInfo event to accomplish this?

Many thanks!

>Hi Patrick,

If your intension is to display any record values in the group caption, then first you would have to disable the covered range over the group caption. You can achieve this by setting the ShowCaptionSummaryCells property to true.

ggc.TopLevelGroupOptions.ShowCaptionSummaryCells = true;
ggc.ChildGroupOptions.ShowCaptionSummaryCells = true;

Then you would have to handle the QueryCellStyleInfo event and provide the corresponding cell values to those cells in group caption. Please try this and let us know if it helps you.

Regards,
Saravanan

haneefm [Syncfusion]
Replied On October 4, 2007 05:22 PM

Hi Patrick,

Please refer to the attached sample for implementation and let me know if this helps.
CaptionTextSample.zip

Below are the codes that display first record values in a GridCaptionRow.

void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.GroupedColumn != null)
{
Element el = e.TableCellIdentity.DisplayElement;
if (el.ParentGroup.GroupTypedListRecords.Count > 0)
{
switch (e.TableCellIdentity.TableCellType)
{
case GridTableCellType.GroupCaptionCell:
Record rec = el.ParentGroup.GroupTypedListRecords[0];
e.Style.CellValue = rec.GetValue(e.TableCellIdentity.GroupedColumn.Name);
break;
case GridTableCellType.GroupCaptionSummaryCell:
Record rec1 = el.ParentGroup.GroupTypedListRecords[0];

if (e.TableCellIdentity.SummaryColumn != null)
e.Style.CellValue = rec1.GetValue(e.TableCellIdentity.SummaryColumn.Name);
else
{
GridTableDescriptor _td = el.ParentTableDescriptor as GridTableDescriptor;
int field = _td.ColIndexToField( e.TableCellIdentity.ColIndex );
if (field != -1 && field < _td.Columns.Count)
{
string _colName = _td.Columns[field].Name;
e.Style.CellValue = rec1.GetValue(_colName);
}
else
e.Style.CellValue = string.Empty;
}
break;
}
}
}
}

Best regards,
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.

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.

;