I have a tree that has been populated with data. I go off the view and then when I come back into the view I want the tree to expand automagically to the place it was before.
My current code is at: https://bwstage.gates.com/goodreasons/pslite.7z
database is https://bwstage.gates.com/goodreasons/pslite.bak
Steps to reproduce are: on the left hand side select down to engine level (pass car, acura, 2012, etc,ect)
Then click on the Add Application at the top, then click back to Home (top right) which will bring you back to the previous page. I am trying to get the tree to auto-expand here.
I get the first Leaf expanded, but then when I do this:
TreeObject.ActivateItem = xamTreeItem within the event, it seems to shut off event notifications.
So the child items never expand out.
Any solution to this?
Here is my new sample function that should do this:
private void expandTreeData()
{
if (prdAppSVM.Current_eqa == null)
return;
foreach (XamTreeItem xti in vwEqTree.Items)
if ((string)xti.Header == prdAppSVM.Current_eqa.EquipmentClass)
//prdAppSVM.PopulateDropClass();
vwEqTree.ActiveItem = xti;
currItems = xti.Items;
xti.IsExpanded = true;
//prdAppSVM.LoadMakes((string)xti.Header, xti);
}
foreach (XamTreeItem xti in currItems)
if ((string)xti.Header == prdAppSVM.Current_eqa.EquipmentMake)
if ((string)xti.Header == prdAppSVM.Current_eqa.EquipmentYear)
if ((string)xti.Header == prdAppSVM.Current_eqa.EquipmentType)
if ((string)xti.Header == prdAppSVM.Current_eqa.EquipmentModel)
if ((string)xti.Header == prdAppSVM.Current_eqa.EquipmentEngine)
Sincerely, MattDeveloper Support Engineer