Home - Forums-.NET - FlyGrid.Net (Windows Forms) - get new node in flygrid

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

get new node in flygrid
Link Posted: 14-Feb-2006 00:39
Hi,
I'm doing drag n drop from Treeview to Flygrid. Works fine. All I need now is the node that correspond to the new row in Flygrid, because data of the dragged treenode should be dropped on the new node only, but I don't know how to get it, I'm sure it is very simple but i can't find the right property.
can you help
thanks
Link Posted: 14-Feb-2006 01:42
Did you mean how to show New Row node?
[c#]
FlyGrid.Rows.Options |= RowsOptions.ShowAddNewRow;

or did you mean addition of dropped node from Treeview as NineRays.Windows.Forms.Data.TreeViewNode?
[c#]
private NodeBase AddNodeToFlyGrid(FlyGrid flyGrid, System.Windows.Forms.TreeNode node)
{
  return AddNodeFromMSTreeView(flyGrid.Rows.RootNode, node);
}

private NodeBase AddNodeFromMSTreeView(NodeBase parent, System.Windows.Forms.TreeNode node)
{
  NineRays.Windows.Forms.Data.TreeViewNode newNode = new NineRays.Windows.Forms.Data.TreeViewNode(new object[]{node.Text});
  newNode.ImageIndex = node.ImageIndex;
  newNode.SelectedImageIndex = node.SelectedImageIndex;
  if (node.Nodes.Count > 0)//if node has children
  {
    //add children
    foreach(TreeNode child in node.Nodes)
    {
      AddNodeFromMSTreeView(newNode, child);
    }
  }
  flyGrid.Rows.Items.Add(newNode);
  return newNode;
}
Link Posted: 14-Feb-2006 02:24
No, what i want is much simpler. I want to get the node corresponding to
the new row of the flygrid.

But in fact it was easy....   :

dg.Rows.Items(dg.Rows.Items.Count - 1).Item(0) = treeNode.Text

Thanks