I try to set Focus as follows:
bool isFocused = xamTreeItem.Focus();
isFocused is false and visually you can tell the control doesn't receive focus.
Update: I set xamTreeItem.IsTabStop = true after reading about Control.Focus() and now xamTreeItem.Focus() returns true. However, the focus actually ends up on the parent of xamTreeItem. I have searched for ".Focus()" throughout the Project and cannott see another Focus() to account for this.
Also, when I remove the set focus statement above, the parent no longer receives focus.
Please help ASAP.
I understand now. Thanks again!
Hello Joe,
In XamTree you have a property called SelectionType. When this property is set to Extent you can select more than one item from the XamTree, but the ActiveItem is always one item. The ActiveItem is the item which has been selected last. You can see the attached screenshot in which you can see than there are three selected items in the XamTree but the last item is the active item.
If you need any further assistance please do not hesitate to ask.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Thank you Krasimir. That helped a whole lot.
I still would like to know more about the distinction between ActiveItem and IsSelected. I have found that ActiveItem by its self set focus and surrounds the item with a border of dashed lines. I have to also set IsSelected == true in order for the iitem background to appear blue.
Please elaborate a bit on how it is expected that these two settings be used.
Thanks again!
Joe
Hello,
I have created a sample application for you that demonstrates how you can use XamTree’s ActiveItem property in order to achieve the functionality that you are looking for. By setting the ActiveItem property you can set the focus to specific node in the XamTree.