mikem
  • mikem
  • Member Topic Starter
2014-05-03T10:16:00Z
I am developing a tree that has different levels

e.g.


Folder1
--| Folder 2
--|---| Folder 3
--|Folder 4
Folder 5
--| Folder 6
--| Folder 7
--|---| Folder 8
--|---|---| Folder 9

If I select a rows, e.g. Folder 5 has 4 folders/levels below it, is it possible to determine the number of levels?

?

More questions about tree..

If I want to select say Folder 8 is it possible to parse back through the tree and build the original structure ..
e.g. Folder8\Folder7\Folder5\

Also, is the igRow.level parameter used only for position/formatting or can it be used as an index?
Is there any way to determine parents/children of a specific node in the tree ?

What I need to be able to do is select on a folder and rebuild the flat structure as described above..
Igor/10Tec
2014-05-05T06:38:02Z
The general answer to all your questions about trees in iGrid.NET is the following.

iGrid is a grid control first of all (a cell matrix), and it does not provide you with such features like GetParentNode or GetLastChildNode which are specific for tree controls. The iGRow.Level property is used to create row hierarchy, and it is really mainly used to indicate the level of nesting visually on the screen. However, these values are used internally by iGrid to determine what rows should be collapsed/expanded when you click the plus/minus button in a tree node or a group row.

To implement the tree functions you need, you should code them by yourself. They all will be enough simple and will be based on the row Level property. For instance, if you need to find the parent node for a specified row, you need to enumerate rows to the top starting from the specified row and find the first row with the iGRow.Level property which is less by 1.

If you need any help with implementing these functions, you can send us your request to our main tech support address.