Hi,
i have a question regarding the xamtreegrid in combination with the context menu. I have created a context menu for the different elements in the tree.
Thererore, if i click on such a element i get the element with the GetClickedElements() method in the opening event and according to the specific
element i change the visibilies of the different context menu items. This works pretty fine for me. Additionally if i do not click on a specific element (click on the white background of the xamTreegrid Control => GetClickedElements() returns zero clicked elements), i show different context menu items for the tree.
The main problem now is, if i expand all records in the tree with xTree.Records.ExpandAll(true) and the collapse all records with xTree.Records.CollapseAll(true), the context menu does not work correctly. Now if i click only into the white tree view control and not on a specific field the GetClickedElements() method in the context menu opening window returns now the element that was shown at this position after all records were expanded! So maybe there is a problem inside the xTree.Records.CollapseAll(true).
So how can i refresh the tree after collapsing all records in order to avoid this problem? Or are there other solutions?
Many thanks in advance!
BR Rene
Hello Rene,
Thank you for your post.
I have been looking into your issue and what I can suggest is to call the UpdateLayout method of XamTreeGrid after calling the xTree.Records.ExpandAll(true) and also after xTree.Records.CollapseAll(true). You can read more details about UpdateLayout method from the following link:
https://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k(System.Windows.UIElement.UpdateLayout)&rd=true
Please let me know if I am missing something from your scenario and do not hesitate to ask if you have any questions regarding this matter.
Thank you for using Infragistics Components!
Thank you for your reply!
Adding the UpdadeLayout call after both methods does not fix the problem. I still get an element from the e.GetClickedElements() method if i click on the
empty background after i expand and collapse the nodes from the tree..
BR,
Rene