We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Stopping TreeViewAdv nodes changing

Thread ID:

Created:

Updated:

Platform:

Replies:

89314 Aug 21,2009 03:22 PM UTC Aug 24,2009 01:29 PM UTC WPF 1
loading
Tags: Tools
Anton De Gruchy
Asked On August 21, 2009 03:22 PM UTC

I need to prevent a user from selecting a node based on some validation. In the WinForms version of the TreeViewAdv I can use BeforeSelect and pass args.Cancel = true. How do I achieve the same thing with the WPF tree?

C. Sudha [Syncfusion]
Replied On August 24, 2009 01:29 PM UTC

Hi,

Currently, we didnt have that feature in TreeViewAdv control. However, Your requirments will be acheived by workaround.

For instance, In selected event, you write the following code snippet,

C#

private void item1_Selected(object sender, RoutedEventArgs e)
{
if (!item1selected )
{
item1selected = true;
}
else
{
(sender as TreeViewItemAdv).IsSelected = false;
}
}

Please download the attached sample for more reference.

Please let us know if you have any questions.

Thanks for choosing Syncfusion products.

Regards,
SudhaC.



TreeViewAdv_Demo_8bd30cec.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;