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
1425
WPF, NET 4.5, XamDataTree 13.2
posted

I'm trying to select a XamDataTree node programmatically. In 13.1 this worked. Is 13.2, I get an exception "object reference not set to an instance of an object" on the last line, "tnSim.IsActive = true. I can't determine what is null. Why is the previous line not a problem. 

var tnCase = xamDataTreeCases.Nodes[0];

var tnSim = tnCase.Nodes[tnCase.Nodes.Count - 1]; // getting the last node of the parent

tnSim.IsSelected = true;

tnSim.IsActive = true; 

Parents
  • 14517
    Offline posted

    Hello Michael,

    I followed the steps you suggested and was unable to reproduce the behavior you're describing.  I created a tree bound to two levels and then executed your code in a button click to select the last child node of the first node in the tree. The first node was then expanded and the last child was selected

    I have attached the sample project I used to test this.  Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.

    If the project does show the product feature working correctly, this indicates a possible problem in the code of your application.  It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.

    Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.

    Please let me know if I can provide any further assistance.

    Sincerely,

    Valerie

    Developer Support Supervisor - XAML

    Infragistics

    www.infragistics.com/support

    BaseTree.zip
Reply Children
No Data