Home - Forums-.NET - FlyGrid.Net (Windows Forms) - How to choose icon to each node

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

How to choose icon to each node
Link Posted: 15-Aug-2005 21:54
I use virtual node
and also i use initnewnode method.
but it gives me only a "parent " node as parameter.
so i can only choose an icon to give to all childs of parent node.
how can i give to each node diffrent icon
(i can take icon index from the data row of the current node)?
Link Posted: 16-Aug-2005 01:16
In the InitNewNode you can create your own node and set Node.SelectedIndex/ImageIndex properties to display icons.
Link Posted: 16-Aug-2005 01:54
How can i get my node? i get only a parent node here as a parameter?


private NodeBase flyGrid1_VirtualMode_InitNewNode(object sender, NodeBase parent , int index)
        {
            clsCustomImageNode clsMyImageNode = new clsCustomImageNode (parent);
            clsMyImageNode.ImageIndex = 2;
            clsMyImageNode.SelectedImageIndex = 2;
            return clsMyImageNode ;
        }


[/code]
Link Posted: 16-Aug-2005 04:30
[quote="ilya"]How can i get my node? i get only a parent node here as a parameter?


and index parameter.

[quote="ilya"]

private NodeBase flyGrid1_VirtualMode_InitNewNode(object sender, NodeBase parent , int index)
        {
            clsCustomImageNode clsMyImageNode = new clsCustomImageNode (parent);
            clsMyImageNode.ImageIndex = 2;
            clsMyImageNode.SelectedImageIndex = 2;
            return clsMyImageNode ;
        }


Yes. FlyGrid will call this method when VirtualMode_GetCount returns more great value than current or after calling FlyGrid.Rows.Reset/ResetNodes.

  If you use your own node class, you can init ImageIndex/SelectedImageIndex properties internally - in the your node class constructor.