Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Easy way to a gradient background?

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

Easy way to a gradient background?
Link Posted: 20-Nov-2007 05:27
Hi,
i searched for gradient and background in the forum, but i can't find, what i need.
Until now i don't use an stylist with my flygrid. And if possible i don't want to use one.

But i need to change the backgrounds colour. And this without a picture or something like this.
I can't find a good event (C#) to change the background colour and paint style.
If you could help me or give me an idea, it would be wonderfull.


Greetings
Curar
Link Posted: 20-Nov-2007 07:46
Curar,

You can refer to GradientStylist example, and pay attention to DrawControlBackground method.

Is it what you need?
Link Posted: 20-Nov-2007 21:13
I would like to say \"Yes\" or \"No\". The problem is, that i don't know, where i can find this example.

[Edit]
Now i found a way to make a gradient background. And its really easy. Only initialize the GradientStylist and set it as the stylist for your grid.

But i have still two questions.
1.) How can i choose the two colours for the gradient?
2.) And how can i make the gradient vertical?

Thanks agian.
[/Edit]
Link Posted: 20-Nov-2007 23:04
Open the GradientStylist.cs (typically at C:\\Program Files\\9Rays.Net\\FlyGrid.Net\\SDK\\Stylist directory),
find the DrawControlBackground method,

as you see, it uses
LinearGradientMode.Horizontal

All you need is to use vertical one instead.
Link Posted: 21-Nov-2007 04:06
Perfekt, Thanks. With your respons i was able to get a solution for my problem.
Link Posted: 19-Jan-2008 05:11
Hi, i have a new Question...

I use the Grid in unbound mode (flygrid.Rows.Items.Add(xyz));
For this, i made a new TreeViewNode and this i add to the rows.
And to my 6 topic rows i add then their childs.

Now i have the Problem, that when i sort, the 6 topic rows will be sorted, too.
Can i force the grid, only to sort the childs and let the parents like they are.

Thanks for Respond.


Gru? Curar
Link Posted: 20-Jan-2008 00:48
Do you use a hierarchy column?
In case when you need to make grid sort only nested columns, you need to use nested grids (which have separate sorting)