[c#]
public class AdvFlyGrid : FlyGrid
{
public virtual void SelectCell(NodeBase node, Column col)
{
if (node != null && col != null)
{
int colIndex = this.Columns.GetColumnCellIndex(col);
if (colIndex != -1)
{
this.FocusNode(this.ActiveRootPort, node, colIndex, true);
this.Selected = node;
}
}
}
}
usage:
[c#]
//this handler gets current selected node, selects next and focus
//cell on second column
private void button2_Click(object sender, System.EventArgs e)
{
NodeBase node = virtualGrid.Selected;
NodeBase next = node.GetNext() as NodeBase;
//if next node is null (selected node is last node), we get first
if (next == null)
next = node.Owner.GetFirst() as NodeBase;
if (next != null)
{
virtualGrid.SelectCell(next, virtualGrid.Columns.Items[1]);
}
}