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

CurrentItem on Tree?

1 Answer 58 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Julien
Top achievements
Rank 1
Julien asked on 21 Sep 2010, 02:02 PM
Hi!

What is the correspondence of the RadGridView and the RadTreeView??

Not the SelectedItem, but the CurrentItem, BECAUSE:

There is no "SelectionChanging", so I'm forced to code myself the revert to the previous element if my conditions aren't satisfied.

Then I was doing something like:

private void uxRadTreeView_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
  if (!isReverting && MyConditionsHere){
    isReverting = true;
    MainTree.SelectedItem =e.RemovedItems[0];
  }
  if(isReverting)
    isReverting = false;
}

The object seems to be "selected", but doesn't change:

image of the selected item problem

File2 is the File on which I've made a "MainTree.SelectedItem= e.RemovedItems[0]"

The File1 is the e.AddedItem[0].

Without the SelectedItem manipulation, I don't see the dashed border on it.

Thank you.

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 23 Sep 2010, 01:38 PM
Hi Julien,

You can cancel the selection by handling the RadTreeView PreviewSelectionChanged() event. Please try that  approach and let us know if it works for you.

Kind regards,
Tina Stancheva
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
Julien
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or