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
close icon

AutoSize Group Header

I thought it would be something like:
this.ggcPandL.ChildGroupOptions.Autosize = true;

ie Autosize the cell with the CaptionText.

Thanks
Hu Anderson

1 Reply

AD Administrator Syncfusion Team January 29, 2007 10:16 AM UTC

Hi Hu,

Thank you for being patience.

This can be achieved by handling the QueryCoveredRange event. In the event, the caption text cell is made to cover some cells to make the text completely visible. The following is the code snippet.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>
GridTable thisTable = this.gridGroupingControl1.Table;
if (e.RowIndex < thisTable.DisplayElements.Count)
{
Element el = thisTable.DisplayElements[e.RowIndex];
switch (el.Kind)
{
case DisplayElementKind.Caption:
{
// Cover some cells of the caption bar (specified with captionCover)
IGridGroupOptionsSource gs = el.ParentGroup as IGridGroupOptionsSource;
if (gs != null && gs.GroupOptions.ShowCaptionSummaryCells)
{
int startCol = el.GroupLevel + 1;
if (!gs.GroupOptions.ShowCaptionPlusMinus)
startCol--;
if (e.ColIndex >= startCol && e.ColIndex <= startCol + this.captionCoverCols)
{
e.Range = GridRangeInfo.Cells(e.RowIndex, startCol, e.RowIndex, startCol + this.captionCoverCols);
e.Handled = true;
}
}
break;
}
}
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Please refer to the our shipped browser sample ‘SortBySummaryInCaption‘ [ \\windows\Grid.Grouping.Windows\Samples\Summaries\SortBySummaryInCaption ]

Kindly let us know if you need any further assistance.
Have a nice day.

Best regards,
Madhan

Loader.
Live Chat Icon For mobile
Up arrow icon