View previous topic :: View next topic |
Author |
Message |
egl
Joined: 27 Jun 2006 Posts: 15 Location: Switzerland
|
Posted: Tue Nov 13, 2007 3:11 am Post subject: get all dataviews |
|
|
hello,
on a part of my code i would like to iterate over all rows shown in the tree. because i don't know what the datasource of the tree is, i would like go get the used dataview of every datatable shown in the tree. i could get the datatable, but i can not be sure that the tree really shows all its data because it could use a dataview with a filter.
could you explaine me how i can get all dataviews or how i can get the data shown in the tree on a other way?
thanks very much
jürg |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Nov 13, 2007 7:11 am Post subject: |
|
|
There are a couple of different ways you can iterate over the rows. One is to get a list of all the visible rows by calling
Code: | VirtualTree.GetRows(VirtualTree.FirstIndex, VirtualTree.LastIndex) |
This only returns the rows that would be visible if you scrolled through the tree (ie their parent has been expanded). If you want to find all possible rows (including rows that haven't been expanded) then you would need to start from VirtualTree.RootRow and iterate over the child rows eg
Code: | Row row = _myTree.RootRow;
for (int i=0; i < row.NumChildren; i++)
{
Row childRow = row.ChildRowByIndex(i);
} |
To traverse the entire tree you would need to recursively iterate through the children of the child rows. _________________ Infralution Support |
|
Back to top |
|
|
|