View previous topic :: View next topic |
Author |
Message |
yaniv
Joined: 27 May 2007 Posts: 2
|
Posted: Mon Jul 09, 2007 7:16 am Post subject: Example of Selection Needed |
|
|
(Virtual Trees)
Hello,
Can you please provide an example, on how to programatically Select a single Row, and how to programatically get it's columns values.
Thanks in advance. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Jul 09, 2007 8:53 am Post subject: |
|
|
To programmatically select a row you would normally simply set the VirtualTree.SelectedItem property to the object the row is bound to. This will work provided each object from your data source corresponds to a unique position in the tree hierarchy and you have set up the parent/child hierarchy (see the "Simple Row Location Interface" section under "Working with Rows" in the online help for more detail). eg
virtualTree.SelectedItem = myObject
If an object can appear multiple times in the hierarchy then you need to find the VirtualTree Row object that corresponds to the row (using one of the VirtualTree.FindRow methods) and then set the VirtualTree.SelectedRow property.
Since you set up the binding between the object and the columns you should know which properties to call on your object to get the given column values. You could call the RowBinding.GetCellData method to retrieve the actual column data for a given row if you needed that. _________________ Infralution Support |
|
Back to top |
|
|
|