Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
20446 | Oct 19,2004 10:16 AM UTC | Oct 24,2004 11:40 AM UTC | WinForms | 6 |
![]() |
Tags: Grouping |
gridSummaryColumnDescriptor4.Format = "{Average:#,###.00}";
gridSummaryColumnDescriptor4.Name = "CurrentFaceAvg";
gridSummaryColumnDescriptor4.DataMember = "CurrentFace";
gridSummaryColumnDescriptor4.SummaryType = Syncfusion.Grouping.SummaryType.DoubleAggregate;
gridSummaryColumnDescriptor5.DisplayColumn = "PositionCount";
gridSummaryColumnDescriptor5.Format = "{Average}";
gridSummaryColumnDescriptor5.Name = "PositionCountAvg";
gridSummaryColumnDescriptor5.DataMember= "PositionCount";
gridSummaryColumnDescriptor5.SummaryType = Syncfusion.Grouping.SummaryType.Int32Aggregate;
(DataMember was not set)
Line 714:
string strISIN = (group.Category != null) ? group.Category.ToString() : "null";
(group.Category is always null for TopLevelGroup)
Regarding your question about a built-in summary type for repeating values. No, there is no such summary. But your MaxStringSummary implementation should do the job.
Let me know if you have any problems with the custom summary.
Stefan
private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
Element el = e.TableCellIdentity.DisplayElement;
if (el is CaptionRow)
{
// you can get the column as follows:
GridColumnDescriptor column = e.TableCellIdentity.Table.GetColumnDescriptorAt(e.Style.TableCellIdentity.RowIndex+1, e.Style.TableCellIdentity.ColIndex);
// - or
GridColumnDescriptor column = e.TableCellIdentity.Column;
// Using that column you could try and identify the summary that should be displayed in this cell.
e.Style.CellValue = e.TableCellIdentity.ParentGroup.GetFirstRecord().GetValue(column.MappingName);
}
}
Stefan
Group g = e.TableCellIdentity.ParentGroup;
Record r = g != null ? g.GetFirstRecord() : null;
object valueOfFirstRecord = r != null ? r.GetValue(column.MappingName) : null;
e.Style.CellValue = valueOfFirstRecord;
3) The function should not interfere with your other functions logic as long as the column "MyColumnNameIWantToSupplySummaryFor" is not also in your ISINModifiedColumns hashtable. That should normally not be the case.
The SummaryColumn will also be null once you do not add the CurrentFaceAvg and PositionCountAvg summary descriptors any more.
4) The TableCellIdentity.SummaryColumn is available for cells that are dependant on a summary descriptor to fill in the value.
GridSummaryColumDescriptor has a DisplayColumn property. This property defines the target column at which to display the summary. If QueryCellStyleInfo is raised for the target column, then TableCellIdentity.SummaryColumn will have a reference to the associated summary column.
Stefan
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.
This page will automatically be redirected to the sign-in page in 10 seconds.