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

treeview
Link Posted: 29-Aug-2005 15:10
hello,

i downloaded your flygrid.net component and wondering if is possible to make grid display hiearchy without me doing it manually in the code.

let's assume that my collection might look something like this..

object[] _collection = new object[3];
_collection[0] = new object[] {"Root", string.Empty} // Key, ParentKey
_collection[1] = new object[] {"Node1", "Root"} // Key, ParentKey
_collection[2] = new object[] {"Node2", "Root"} // Key, ParentKey

what would be the totally easiest way to display it correctly in the grid?
thanks,
luke
Link Posted: 29-Aug-2005 17:14
More easiest way is following:

//Add Columns
flyGrid.Columns.AddRange(new Column[]
    {
      new TreeViewColumn("Nodes");
      new Column("Data");
     });

//create root node
Node rootNode= new TreeViewNode(new object[]{"Root", string.Empty});
//create sub nodes (children)
Node firstNode= new TreeViewNode(new object[]{"First", string.Empty});
Node secondNode= new TreeViewNode(new object[]{"Second", string.Empty});
//add children
rootNode.Items.AddRange(new NodeBase[]{firstNode, secondNode});
//Add to FlyGrid
flyGrid.Rows.Items.Add(rootNode);


Also you can see the TreeView Replacement,  NestedGrids, Self Related Hierarchical Grid (Virtual Grid) and  Self Related Hierarchical Grid (DataBound Grid) samples source.[/code]