Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Programmatically select Root node in Treeview

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

Programmatically select Root node in Treeview
Link Posted: 18-Dec-2006 08:08
I would like to programmatically select the Root Node in my FlyGrid Treeview, so that the associated data is populated on my form on load. This will prevent the user from having to select the node.

Here is what i'm trying:

            Dim node As NineRays.Windows.Forms.Data.NodeBase
            node = selfRelatedGrid.Rows.GetNodeFromRow(0)
            drvData = GetNodeRow(node)

However, the node is evaluating to \"Nothing\". What am I doing wrong?

Thanks!

Eric
Link Posted: 26-Dec-2006 06:19
BUMP - Anyone?
Link Posted: 02-Jan-2007 04:33
Hoping someone might be able to help on this...
Link Posted: 05-Jan-2007 04:37
Pink Floyd said:

\"Is there anybody... OUT THERE?\"

HELP!
Link Posted: 15-Jan-2007 04:30
Anyone have an idea on this?
Link Posted: 15-Jan-2007 06:08
Sorry for delays with support, 9Rays just returned from vacations.
Try before using
[VB.Net]
Dim node As NineRays.Windows.Forms.Data.NodeBase
node = selfRelatedGrid.Rows.GetNodeFromRow(0)

to recoginize number of items:
[VB.Net]
If (selfRelatedGrid.Rows.Items.Count > 0) Then
  Dim node As NineRays.Windows.Forms.Data.NodeBase
  node = selfRelatedGrid.Rows.GetNodeFromRow(0)
End If
Link Posted: 18-Jan-2007 05:21
Your response basically restates the original code snippet I posted...

Dim node As NineRays.Windows.Forms.Data.NodeBase
node = selfRelatedGrid.Rows.GetNodeFromRow(0)
drvData = GetNodeRow(node)


This results in node=Nothing. I am not sure why since the selfRelatedGrid has been populated at the point that I invoke the code.

I am also wondering how the row in the grid can be highlighted programatically, since the above code will only select the data.

Thanks!

Eric
Link Posted: 18-Jan-2007 06:43
But, do you check the count of rows/nodes?
[Vb.Net]
If (selfRelatedGrid.Rows.Items.Count > 0) Then
....