Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
135
XamDataTree GetNodesFromItems doesn't work
posted

Hello,

I'm trying to get a list of all selected nodes.

I found GetNodesFromItems method, but it always returns empty result even when SelectedDataItems is not empty:

if (sender is XamDataTree dataTree && e.OriginalSource is TextBlock)
{
    var selectedNodes = dataTree.GetNodesFromItems(dataTree.SelectedDataItems, false);
}

Am I doing something wrong?

Parents
  • 7555
    Verified Answer
    Offline posted

    Hello Alexis,

    Thank you for your post. The GetNodesFromItems method returns empty collection because your set the 2nd parameter(recursive) to false.

    I set up a small demo sample using GetNodesFromItems  method and it is returning selected node collection as expected.

    Refer the sample and let me know of you have any question.

    Sincerely,

    Divya Jain

     7536.Sample.zip

Reply Children
No Data