How to set focused node Devexpress TreeListControl

iXed picture iXed · Jun 18, 2011 · Viewed 7.7k times · Source

I'd like to change the focused node in my TreeListControl via code. For the sake of simplicity, I have this example:

  • A grid has two columns, left we have a TreeListControl, and at right there is a Canvas.
  • The TreeListControl is populated with nodes corresponding to some shapes in the Canvas (such as the shapes name, etc.).
  • What I already have done, is to highlight the shape in the Canvas by selecting the corresponding node in the TreeListControl.
  • Now what I'd want to do is the other way around: to change the focused node in the TreeListControl by clicking on a shape in the canvas.

Thanks in advance

Answer

DevExpress Team picture DevExpress Team · Jun 20, 2011

You should set the TreeListControl's FocusedRow property to the instance of business object. In this case, everything should work properly.