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. Image for the cookie policy date

Finding columns associated with CaptionSummaryRows

I''m trying to hide the value in the cells of various detail records when that column is a column which is part of a CaptionSummaryRow. I''ve been using the following test in my QueryCellStyleInfo event handler: if ((e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell || e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell) && e.TableCellIdentity.SummaryColumn != null) I thought that the e.TableCellIdentity.SummaryColumn property told me whether a column was associated with any CaptionSummaryRow in a grid. Can you please tell me how to properly find this out in the event handler?

2 Replies

AD Administrator Syncfusion Team October 27, 2004 06:21 AM UTC

e.TableCellIdentity.SummaryColumn is only set if th eelement is a captionrow or summaryrow. So, if you want this information on recordrows, then you would have to track it yourself. You could add a private ArrayList member, and add the column names used in your summaries to the ArrayList as you add the columns to teh summaryrow. Then in QueryCellStyleInfo, you could use code like this where colsInSummary is the arraylist:
//blanks out the summary column
if ((e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell 
|| e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)
&& this.colsInSummary.IndexOf(e.TableCellIdentity.SummaryColumn.Column.Name) > -1)
{
	e.Style.CellValue = "";
}


AD Administrator Syncfusion Team October 27, 2004 06:34 AM UTC

If you want to catch the cell in the summary itself (as opposed to the record cells contributing to the summary), then you can use code like if ((e.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionSummaryCell && e.TableCellIdentity.SummaryColumn != null) since e.TableCellIdentity.SummaryColumn should be set for these cell types.

Loader.
Up arrow icon