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.

Child Group Headings

Thread ID:

Created:

Updated:

Platform:

Replies:

26196 Mar 16,2005 10:45 AM Mar 16,2005 07:31 PM Windows Forms 2
loading
Tags: Grouping
David Arndt
Asked On March 16, 2005 10:45 AM

Two questions: 1) Is it possible to show/hide the display of column headings for a *particular* child grouping? I''ve got a grouping that is 3 levels deep. I want to display headings on the first child group, but not below that level. 2) Is it possible to customize the text that appears in column headings in child groups? It seems like the text is taken from the data source column name and that there is no way to override this. I''ve tried handling drawing events for the cell - but changing the display text has no effect. I''ve also tried handling the QueryCellText and QueryValue events, but the QueryCellText only fires for "IndentCells" (!!!???) and the QueryValue event seems to NEVER fire. (Essential Tools is a nice product - but documentation that comes with help and the examples is woefully inadequate, in my opinion.) - da

David Arndt
Replied On March 16, 2005 12:00 PM

Answered my own question: You can cancel the drawing event and handle the drawing yourself from with the cell, as shown below. In my opinion, this event would be more meaningful if it were fired *before* the drawing takes place so you can simply change the display text and let the control do the actual drawing. if ( e.Inner.Style.CellType == "ColumnHeaderCell" ) { System.Diagnostics.Trace.WriteLine( string.Format("{0}:{1},''{2}''", e.Inner.Style.CellType, e.Inner.Style.CellValue, e.Inner.DisplayText ) ); Brush aBrush = new SolidBrush( Color.Black ); e.Inner.Graphics.DrawString( e.Inner.DisplayText + "!", this.Font, aBrush, e.Inner.TextRectangle ); e.Inner.Cancel = true; aBrush.Dispose(); } >Two questions: > >1) Is it possible to show/hide the display of column headings for a *particular* child grouping? I''ve got a grouping that is 3 levels deep. I want to display headings on the first child group, but not below that level. > >2) Is it possible to customize the text that appears in column headings in child groups? It seems like the text is taken from the data source column name and that there is no way to override this. I''ve tried handling drawing events for the cell - but changing the display text has no effect. I''ve also tried handling the QueryCellText and QueryValue events, but the QueryCellText only fires for "IndentCells" (!!!???) and the QueryValue event seems to NEVER fire. > >(Essential Tools is a nice product - but documentation that comes with help and the examples is woefully inadequate, in my opinion.) > >- da

Administrator [Syncfusion]
Replied On March 16, 2005 07:31 PM

Dave, 1) Each GridColumnDescriptor has a GridColumnDescriptor.GroupByOptions property where you can define group options for a certain group level. The GridColumnDescriptor.GroupByOptions will have precedence over TableDescriptor.ChildGroupOptions for the grouping level that is matching the GridColumnDescriptor.MappingName of the column (e.g. you have “Country” column and you then later group by the “Country” field). 2) You can handle the QueryCellStyleInfo event to replace the text before it is drawn – see the CustomSectionInGroup example for handling QueryCellStyleInfo. Stefan >Answered my own question: You can cancel the drawing event and handle the drawing yourself from with the cell, as shown below. In my opinion, this event would be more meaningful if it were fired *before* the drawing takes place so you can simply change the display text and let the control do the actual drawing. > > > if ( e.Inner.Style.CellType == "ColumnHeaderCell" ) > { > System.Diagnostics.Trace.WriteLine( string.Format("{0}:{1},''{2}''", e.Inner.Style.CellType, e.Inner.Style.CellValue, e.Inner.DisplayText ) ); > > Brush aBrush = new SolidBrush( Color.Black ); > e.Inner.Graphics.DrawString( e.Inner.DisplayText + "!", this.Font, aBrush, e.Inner.TextRectangle ); > e.Inner.Cancel = true; > > aBrush.Dispose(); > } > >>Two questions: >> >>1) Is it possible to show/hide the display of column headings for a *particular* child grouping? I''ve got a grouping that is 3 levels deep. I want to display headings on the first child group, but not below that level. >> >>2) Is it possible to customize the text that appears in column headings in child groups? It seems like the text is taken from the data source column name and that there is no way to override this. I''ve tried handling drawing events for the cell - but changing the display text has no effect. I''ve also tried handling the QueryCellText and QueryValue events, but the QueryCellText only fires for "IndentCells" (!!!???) and the QueryValue event seems to NEVER fire. >> >>(Essential Tools is a nice product - but documentation that comes with help and the examples is woefully inadequate, in my opinion.) >> >>- da

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.

;