Can't focus a treeviewitem by code

3 posts, 0 answers
  1. Alois
    Alois avatar
    6 posts
    Member since:
    Feb 2011

    Posted 23 Sep 2011 Link to this post

    Hi,

    I'm using radtreeview with a hierarchical data template, my own treeview style , items template, items container style and items panel.
    This works all fine, but I can't set the focus of a treeview item with the following code sequence running in a MouseEnter event:

    TreeView.Focus();
    Item.Focus();
    Item.IsSelected = true;

    The Item IsEnabled, IsSelected, IsInView and the parent IsExpanded ... all seems to be prepared for setting the focus - but no success.
    Changing the sequence of this calls or using a Dispatcher for the call doen't help either.

    Any help appreciated!

    Kind regards,
    Alois
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 28 Sep 2011 Link to this post

    Hello Alois,

     Can you please first make sure that your style does not have anything in common with this issue? If it doesn't , is it possible for you to send us more from your code so that we could investigate this problem deeper and be better able to advice you ? Thank you for your cooperation in advance. 

    Best wishes,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Alois
    Alois avatar
    6 posts
    Member since:
    Feb 2011

    Posted 03 Oct 2011 Link to this post

    Hello Petar,

    thanks for your response!
    Recently I did some larger changes to the code so that the upper problem doesn't exist any more.
    Nevertheless I will keep an eye on it and come back to you if the problem will arise again.

    Thank you so far
    Alois
Back to Top