BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
public class GroupingEngine : Engine
{
public override Group CreateGroup(Section parent)
{
return new GroupingGroup(parent);
}
}
public class GroupingGroup : Group
{
public GroupingGroup(Section parent)
: base(parent)
{
}
protected override void OnInitializeSections(bool hasRecords, SortColumnDescriptorCollection fields)
{
this.Sections.Add(this.ParentTableDescriptor.CreateCaptionSection(this));
if (hasRecords)
this.Sections.Add(this.ParentTableDescriptor.CreateRecordsDetails(this, fields));
else
this.Sections.Add(this.ParentTableDescriptor.CreateGroupsDetails(this, fields));
this.Sections.Add(this.ParentTableDescriptor.CreateSummarySection(this));
}
public override bool IsChildVisible(Element el)
{
if (el is CaptionSection)
{
return true;
}
else if (el is DetailsSection)
{
return this.IsExpanded;
}
else if (el is SummarySection)
{
return this.IsExpanded;
}
return true;
}
}
but I think you should stick with grouping control. You can make the caption have multiple columns when you handle the QueryCoveredRange event of GridGroupingControl.TableControl.Model.
void ModelQueryCoveredRange(object sender, GridQueryCoveredRangeEventArgs e)
{
GridTable thisTable = grid.Table;
if (e.RowIndex < thisTable.DisplayElements.Count)
{
Element el = thisTable.DisplayElements[e.RowIndex];
switch (el.Kind)
{
case DisplayElementKind.Caption:
e.Handled = true;
break;
}
}
}
Setting e.Handled will prevent the GridTable class from setting a covered range for captions.
Stefan