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

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

7 Answers 383 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Julian
Top achievements
Rank 1
Julian asked on 14 Apr 2009, 04:10 PM
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



7 Answers, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 15 Apr 2009, 02:13 PM
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.
0
Madhu
Top achievements
Rank 1
answered on 19 Oct 2010, 11:34 AM
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
0
Kiril Stanoev
Telerik team
answered on 19 Oct 2010, 01:19 PM
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
0
Madhu
Top achievements
Rank 1
answered on 20 Oct 2010, 04:01 PM
Dear Kiril,

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

Warm Regards
Madhu
0
Madhu
Top achievements
Rank 1
answered on 22 Oct 2010, 10:24 AM

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

 

0
Petar Mladenov
Telerik team
answered on 27 Oct 2010, 01:24 PM
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
0
Madhu
Top achievements
Rank 1
answered on 27 Oct 2010, 01:29 PM
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
Tags
TreeView
Asked by
Julian
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Madhu
Top achievements
Rank 1
Kiril Stanoev
Telerik team
Petar Mladenov
Telerik team
Share this question
or