1

I have a "simple" RadTreeView. The ItemsSource of my HierarchicalDataTemplate is SubItems.

<HierarchicalDataTemplate ItemsSource="{Binding SubItems}" ...

Drag and Drop seems to work. But I am wondering how the RadTreeView knows that my item is a droppable folder. It seems that if SubItems is null it is NOT a droppable folder. Is it true? Is it the right way to mark an item as "folder" or "file"?

Cœur
  • 37,241
  • 25
  • 195
  • 267
koalabruder
  • 2,794
  • 9
  • 33
  • 40

1 Answers1

0

In the way of data binding you mark an item as "folder or file" by the data model behind that binding.

For example with a property.

public bool IsFolder { ... }

This can also be used for the control to evaluate if drag and drop is enabled for the appropriate item. But as the documentation states this seems to be done in code behind.

For switching the template you can use a customized DataTemplateSelector.

I hope I understood your question in the correct way :D