View previous topic :: View next topic |
Author |
Message |
flc.net
Joined: 21 Jun 2005 Posts: 89 Location: Switzerland
|
Posted: Wed Jul 27, 2005 1:54 pm Post subject: FindRow problems |
|
|
Hi
I have again problems with FindRow
I defined a DataSet with two Tabels an a Relation between this two Tables.
Virtual Tree is configured with two Data Row Binding. The Parent / Child properties of each binding is set correctly.
When I call FindRow(). The Debug Window shows the following Message:
Error: Unable to find path
Path: Infralution.Controls.VirtualTree.Row
Ensure that you have:
A. Set the Parent properties appropriately in the Tree RowBindings; or
B. Handled the GetItemParent event and set the Parent property; or
C. Overridden the GetParentForItem and returned the correct parent object.
Can you look at my Sample App what's wrong?
Thanks
Giuseppe |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Wed Jul 27, 2005 11:22 pm Post subject: |
|
|
Thanks for the sample project - it made diagnosis easy. Actually your FindRow call was fine and succeeded. The problem was that you were using the SelectedItem property (which deals with the domain object not rows) instead of the SelectedRow property. The SelectedItem property does the FindRow for you so your code should look like
Code: |
DataRowView mySearchItem = DataRowRowBinding.GetDataRowView(ds.Companies.Select("Name = 'BMW'")[0]);
tree.SelectedRow = tree.FindRow(mySearchItem);
|
or
Code: |
DataRowView mySearchItem = DataRowRowBinding.GetDataRowView(ds.Companies.Select("Name = 'BMW'")[0]);
tree.SelectedItem = mySearchItem;
|
_________________ Infralution Support |
|
Back to top |
|
|
flc.net
Joined: 21 Jun 2005 Posts: 89 Location: Switzerland
|
Posted: Thu Jul 28, 2005 6:54 am Post subject: |
|
|
*lol* im so stupid
thanks again for your great support.
Giuseppe |
|
Back to top |
|
|
|