Ticket T373574
Visible to All Users

ASPxTreeList - Both client-side and server-side SelectionChanged events are not triggered when the client-side SelectNode method is called

Answers approved by DevExpress Support

created 9 years ago

Our developers have thoroughly analyzed this behavior and confirm that it is correct. Let me elaborate on this.
When the client-side ASPxClientTreeList.SelectNode method is used, both the client-side and server-side SelectionChanged events are not triggered. This is done to avoid sending many callback requests to the server and to improve performance. For example, if an application contains client-side code that selects a lot of nodes, it will not send a callback to the server each time a node is selected.

If it is required to raise the SelectionChanged event on the server side, it is possible to use the client-side ASPxClientTreeList.PerformCallback method. After that, ASPxTreeList will update its state and the server-side ASPxTreeList.SelectionChanged event will be triggered.

JavaScript
tree.SelectNode("0"); tree.PerformCallback();

If some method is used in the client-side ASPxClientTreeList.SelectionChanged event handler, it is required to use this method after a node is selected using the ASPxClientTreeList.SelectNode method.

JavaScript
tree.SelectNode("0"); someClientMethod();

Similar behavior will occur if the TreeListSettingsSelection.Recursive property is set to true. If the ASPxClientTreeList.SelectNode method is used, the parent node will not be selected. To select it, use the client-side ASPxClientTreeList.PerformCallback method after selecting a node on the client side.

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.