DBAdvGrid Customize Group Header Row

Is it possible to customize the header row that is displayed in a TDBAdvGrid when grouping is in effect? My data is grouped by a numeric field and they way it displays is not user-friendly. So instead of "3", I would like the header to say something like "Category 3" etc. The more I work with this component, the more I am not sure how I ever lived without it!

The documentation has precious little information on grouping.

To customize, you could use the event grid.OnGetDisplayText()

Thanks! How can I identify when it is the group field though? In OnGetDisplText(), Value is blank for every instance of ACol=0 (which I guess makes sense as this is the indicator column), but it has the values for field 2 when ACol=1?

I would assume that when you start the grouping, you know the column index and thus the DB field for that group column (DBAdvGrid.Columns[groupcolumn].DataField
In OnGetDisplText(), you can detect whether it is a cell for a group row by checking grid.IsNode(arow): boolean

Thank you once again for your assistance. IsNode() is not even mentioned in the documentation... It did what I was after though.

Checking that ACol=1 and IsNode(ARow) gave me the result I want and my grid looks mostly smashing now. Thanks again.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.