BL
Bert Lowry
September 21, 2004 03:18 PM UTC
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
AD
Administrator
Syncfusion Team
September 21, 2004 05:28 PM UTC
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