Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Alternate row highlighting

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

Alternate row highlighting
Link Posted: 09-Apr-2007 08:05
I'd like to apply a different background color to even-numbered rows, while otherwise keeping the XP style... is there a way to do this without making a full-blown Stylist?  And if there isn't, how would I create that simple stylist?  The only example I have (GradientStylist) seems slightly excessive to work off of.
Link Posted: 09-Apr-2007 15:10
Please see the Virtual Grid and try to use this sample in Styled nodes or CustomDraw nodes modes. You can use this technique to add color to the even-numbered rows.
If you're using non-virtual mode, please remember that Virtual Grid sample uses VirtualNode inheritors, but you should inherit your nodes from NodeBase class.
Link Posted: 13-Apr-2007 01:43
I'm not in virtual mode, and the VirtualMode_InitNewNode event is only firing when I expand to the nested grid.  The top-level elements are all still styled standardly.  Is there another event that I'm missing?
Link Posted: 15-Apr-2007 17:39
Please search this forum for the custom drawing nodes. It's easy to implement custom drawn node to alternate row highlighting.
For example you can see the Tree/ListView replacement sample and move mouse over the rows to see how row can be dynamically highlighted. This sample uses FlyGrid in real mode
Link Posted: 16-Apr-2007 07:47
Sorry if I wasn't clear about this... my flygrid is databound, so there's no point where I say Rows.Items.Add(node).  If there were, I could make it use custom drawing nodes, but the rows are added automatically from the data source, and some of them have children.
Link Posted: 16-Apr-2007 08:26
Well, we'll add rows color alternating feature to the nearest FlyGrid.Net update.