Remove black dotted border around RadTreeViewItem (or generally any UIElement)

8 posts, 1 answers
  1. Julian
    Julian avatar
    16 posts
    Member since:
    Mar 2009

    Posted 14 Apr 2009 Link to this post

    Hi

    When a RadTreeViewItem is selected and the focus is on another element, a black dotted border appears on the focused element.
    This looks like the image shown here:
    http://blogs.windowsclient.net/anshulee/archive/2008/05/16/removing-the-dotted-border-around-selected-wpf-ui-element.aspx

    To remove it using the vanilla WPF elements, I had to use something like this:
    <Style TargetType="{x:Type TreeViewItem}"> 
       
    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    </Style>

    So I tried this with RadTreeViewItem i.e.
    <Style TargetType="{x:Type telerik:RadTreeViewItem}"> 
       
    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    </Style>

    but this does not work. Do you have any workarounds for not showing the dotted border?

    Many thanks



  2. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    442 posts

    Posted 15 Apr 2009 Link to this post

    Hi Julian Borthwick,

    Thank you for your feedback. In order to remove the focus visual indicator from the element you should edit the control template

    Sincerely yours,
    Dimitrina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Madhu
    Madhu avatar
    9 posts
    Member since:
    Aug 2010

    Posted 19 Oct 2010 Link to this post

    Dear Dimitrina,

    I have the exact issue. I need to do it programmatically. I am using radTreeViewItem.Focus() and the item gets focused. But I want to remove the focus indicator for that item. Request you to kindly provide a sample of the same for RadTreeViewItem. Would be really helpful.

    Warm Regards
    Madhu
  5. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 19 Oct 2010 Link to this post

    Hello Madhu,

    You need to apply a Template that has no FocusVisual. Please have a look at the attached project on how to achieve that.

    All the best,
    Kiril Stanoev
    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
  6. Madhu
    Madhu avatar
    9 posts
    Member since:
    Aug 2010

    Posted 20 Oct 2010 Link to this post

    Dear Kiril,

    I was able to get it work for me. Thanks a lot for the sample! :)

    Warm Regards
    Madhu
  7. Madhu
    Madhu avatar
    9 posts
    Member since:
    Aug 2010

    Posted 22 Oct 2010 Link to this post

    Dear Kiril,

    Is it possible to change the styles of the following elements in the RadTreeViewItem control template:
    border by names -  MouseOverVisual, SelectionUnfocusedVisual, SelectionVisual

    to change the appearance of the tree view items like just having the content bold instead of a border on mouse over/selected?

    Kindly send a small sample for the same.

    I was able to achieve the content bold on mouseover/selection. But the child items are also getting bolded along with their parent item. Can this be somehow avoided?

    Thanks in advance.

    Warm Regards
    Madhu

     

  8. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 27 Oct 2010 Link to this post

    Hi Madhu, Could you please examine the attached solution and let me know if it satisfies your needs?  

    In order to use the FontWeight propeerty of the RadTreeViewitem ,  you can change the ContentPresenter named "Header" with a ContentControl.

    In case this solution does not applies to your scenario, could you please be more precise about how you are achieving the bold content on MouseOver so that the child items get bold too? You can send me a sample project as well.

    All the best,
    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
  9. Madhu
    Madhu avatar
    9 posts
    Member since:
    Aug 2010

    Posted 27 Oct 2010 Link to this post

    Dear Petar,

    Thanks a lot for the sample project! As of now, the project that u have attached, satisfies my need. :)

    I will surely get back if I need any more assistance on this.

    Thanks again!

    Warm Regards
    Madhu
Back to Top
UI for WPF is Visual Studio 2017 Ready