Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Paint border on cell when hovered

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

Paint border on cell when hovered
Link Posted: 14-Mar-2006 00:04
Hi,

I'd like to draw a thick border on certain cells when they are hovered with the mouse or clicked on. How could I achieve this?

Thanks,

Tom
Link Posted: 15-Mar-2006 02:16
TreeView/ListView Replacement sample has a some code that colours node under mouse cursor.
You can use the code from TreeView/ListView Replacement sample and modify/improve it for your needs.
Link Posted: 15-Mar-2006 02:54
Well, as you said, this colors a node but I want to color an individual cell from a node only?
Link Posted: 15-Mar-2006 05:35
I think it can be implemented as following:
1. You can create a special node (HoverNode for example) class and in the FlyGrid.MouseMove handler specify hovered node and cell to this node.
2. Changing of HoverNode.HoveredNode and HoverNode.HoveredCell (these properties should be static) invalidate old value of these properties and new values specified.
3. In the painting procedure of Hovernode color of cell specified by HoverNode.HoveredNode and HoverNode.HoveredCell properties will be colored.