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.
Unfortunately, activation email could not send to your email. Please try again.

2 Questions about Grouping Area

Thread ID:





19227 Sep 21,2004 10:37 AM Sep 21,2004 01:28 PM Windows Forms 2
Tags: Grouping
Bert Lowry
Asked On September 21, 2004 10:37 AM

I need to do two things with the Grouping Area in a GroupingControl: 1.) How can I remove the table name that appears on the left side of the grouping area? 2.) How can I set the background color to be a gradient? I would prefer to know how to do this with the control properties (so VS can write the code), rather than writing the code myself. Though any help will be appreciated. -- Bert Lowry

Bert Lowry
Replied On September 21, 2004 11:18 AM

I found the answer to question #1. I set the TableDescriptor.Name in the FormLoad. It doesn''t work if I change it in InitializeComponents(). Further, for some reason, when I set it with the control properties in VS, it doesn''t stick. If I close the project and re-open it, the previous value (the table name) is restored. It works if I set it in the FormLoad, though. I still need an answer to question #2: how do I set the GroupDropArea background color to a gradient? -- Bert Lowry

Administrator [Syncfusion]
Replied On September 21, 2004 01:28 PM

Hi Bert, the following code seems to work. I tried it with the GroupCustomers example: //this.groupingGrid1.GridGroupDropArea.Model.TableStyle.BackColor = Color.Gainsboro; this.groupingGrid1.GridGroupDropArea.DrawCell += new GridDrawCellEventHandler(GridGroupDropArea_DrawCell); this.groupingGrid1.GridGroupDropArea.Paint += new PaintEventHandler(GridGroupDropArea_Paint); this.groupingGrid1.GridGroupDropArea.Model.Properties.BackgroundColor = Color.Transparent; this.groupingGrid1.GridGroupDropArea.Dock = DockStyle.Fill; this.groupingGrid1.GridGroupDropArea.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(GridGroupDropArea_PrepareViewStyleInfo); } bool paintFirst = true; private void GridGroupDropArea_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e) { e.Style.BackColor = Color.Transparent; } private void GridGroupDropArea_Paint(object sender, PaintEventArgs e) { paintFirst = true; } private void GridGroupDropArea_DrawCell(object sender, GridDrawCellEventArgs e) { if (paintFirst) { Control c = (Control) sender; Syncfusion.Drawing.BrushInfo gradient = new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.Horizontal, Color.White, Color.Gray); Syncfusion.Drawing.BrushPaint.FillRectangle(e.Graphics, c.ClientRectangle, gradient); } paintFirst = false; } Stefan


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.

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.