This is a migrated thread and some comments may be shown as answers.

TreeView PreviewUnchecked Event

1 Answer 39 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Gnanavel
Top achievements
Rank 1
Gnanavel asked on 30 Sep 2010, 12:36 PM
I want to prevent unchecking of treeview node based on some condition. I tried setting using e.Handled = true of TreeView PreviewUnchecked Event still the treeview node is unchecked.

 void treeView_PreviewUnchecked(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            RadTreeViewItem item = e.OriginalSource as RadTreeViewItem;
            Node node = (Node)item.Item;

            //Select TreeNode Value when opened from Manage Screen
            if ((XYViewModel.XYPairList != null) && (XYViewModel.XYPairList.Count > 0))
            {
              
                    MessageBox.Show("You cannot uncheck this node as this is part of XY pair. Please delete the XY Pair and uncheck again.", "Node exists in XY Pair", MessageBoxButton.OK);

                    item.CheckState = System.Windows.Automation.ToggleState.On;
                    e.Handled = true;

            }
        }

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 05 Oct 2010, 03:30 PM
Hi Gnanavel,

Unfortunately, I can't reproduce your issue. Can you please take a look at the attached example and let me know if I am missing something. Thank you in advance.

Sincerely yours,
Petar Mladenov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TreeView
Asked by
Gnanavel
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or