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
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
ADAdministrator Syncfusion Team September 21, 2004 01:28 PM
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)
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;