Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Programmatically set focus on row in Virtual Mode

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 set focus on row in Virtual Mode
Link Posted: 07-Feb-2006 06:14
I have a databound heirarchical treeview that populates a form based on the node selection. However, once the node is selected and the form begins to fill with the appropriate data the focus is lost on the selected node.

How do I reset the focus to the selected node? From what I can see in debug mode, I need to access the row through the ActivePort. Here's my closest attempt so far:

    FlyGrid1.ActivePort.Rows.Items(iSelectedIndex).Focused = True

The problem is that although there are 36 rows in the ActivePort.RowCount, the ActivePort.Rows.Items.Count = 4 (the first heirarchical level count). I don't see how to set the focus to the correct row.

Thanks in advance for your help!
Link Posted: 07-Feb-2006 22:26
Use FlyGrid.Rows.GetNodeFromRow (or FlyGrid.ActivePort.Rows.GetNodeFromRow) and FlyGrid.Rows.GetRowFromNode (or FlyGrid.ActivePort.Rows.GetRowFromNode) methods to determine node at row and row of selected node in this case (when FlyGrid has hierarchical structure).