AD
Administrator
Syncfusion Team
October 1, 2004 05:45 PM UTC
Hi Adam,
In QueryCellInfo you can check for
e.TableCellIdentity.TableCellType == GridTableCellType.GridTableCellType.GroupCaptionCell
and set the text that should be shown for the caption bar.
Stefan
AM
Adam Miller
October 1, 2004 07:14 PM UTC
Stefan, that''s not working.
What I''m doing is:
mGroupingGrid.TableDescriptor.ChildGroupOptions.CaptionText = "{CategoryName}: {Category}";
When I group by a column whose value is translated, CaptionText shows the untranslated value.
My DataSource has a Column --> Client.
In the source Client has numerical values.
I want to display the Client''s name. This
is retreived from a lookup table, via the code I posted above int the QueryCellStyleInfo handler.
So, my group captions are showing:
Client: 1
Client: 2
Instead of:
Client: Foo
Client: Bar
If there''s a way to provide this field in the SummaryRow itself where it''s normal column position is, that would be great also.
My SummaryRow looks like this:
GridSummaryRowDescriptor totals = new GridSummaryRowDescriptor("Totals",
new GridSummaryColumnDescriptor[] {
new GridSummaryColumnDescriptor("OrderedShares", SummaryType.Int32Aggregate, "OrderedShares", "{Sum}"),
new GridSummaryColumnDescriptor("ExecutedShares", SummaryType.Int32Aggregate, "ExecutedShares", "{Sum}"),
new GridSummaryColumnDescriptor("NumOrders", SummaryType.Int32Aggregate, "NumOrders", "{Sum}"),
new GridSummaryColumnDescriptor("NumFills", SummaryType.Int32Aggregate, "NumFills", "{Sum}"),
new GridSummaryColumnDescriptor("TotalValue", SummaryType.DoubleAggregate, "TotalValue", "{Sum}")
} );
Then added to the grid as so:
totals.Visible = true;
mGroupingGrid.TableDescriptor.SummaryRows.Add( totals );
mGroupingGrid.TableDescriptor.ChildGroupOptions.ShowCaptionSummaryCells = true;
mGroupingGrid.TableDescriptor.ChildGroupOptions.CaptionText = "{CategoryName}: {Category}";
mGroupingGrid.TableDescriptor.ChildGroupOptions.CaptionSummaryRow = "Totals";
AD
Administrator
Syncfusion Team
October 3, 2004 11:39 PM UTC
Hi Adam,
sorry for the late reply.
Attached find a sample that adds a unbound field to do the mapping. You can group by this unbound field and at the same time hide it in your columns collecion.
The sample also handles QueryCoveredRange and disables the covering for the TopLevelGroup caption and has some comments what you should do in QueryCellStyleInfo.
Stefan
UnboundField_1932.zip