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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Engine + GridControl only

Thread ID:

Created:

Updated:

Platform:

Replies:

11527 Mar 9,2004 02:00 PM UTC Mar 10,2004 01:08 PM UTC WinForms 2
loading
Tags: Grouping
Justin Koh
Asked On March 9, 2004 02:00 PM UTC

I''m trying to use a Grouping.Engine as the data for a GridControl running in virtual mode. The reason I''m not using GridGroupingControl is because I want the grouping rows to be multiple cells and I can''t figure out how to make GridGroupingControl do that. It''s working OK except that when I query DisplayElements.Count, I get elements for AddNewRecord and SummarySection, which I don''t want. If I were using a GridGroupingControl, I could just turn them off in the TableOptions. Is there anything similar in the engine? Or, to solve the problem a different way, can I get multiple columns in the grouping rows in the GridGroupingControl?

Administrator [Syncfusion]
Replied On March 10, 2004 12:04 AM UTC

Hi Justin, to get rid of these section you need to derive from Engine class and override the CreateGroup and method. In your override you can then just add the sections you want, e.g: 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

Justin Koh
Replied On March 10, 2004 01:08 PM UTC

Thank you, Stefan. I''ll give it a shot.

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.

Warning Icon 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.Close Icon

;