"Border" of the last selected item

2 posts, 0 answers
  1. Licensing
    Licensing avatar
    31 posts
    Member since:
    Sep 2011

    Posted 23 Jan 2012 Link to this post

    I have a RadToolBar with buttons on it. When I click on a button a "border" appears around it. After focus is moved to another control the border still remains on the button.

    Is it possible to remove that "border" after toolbar loses focus?
  2. Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 26 Jan 2012 Link to this post


    The border in question is the focus indication of the buttons but as the RadToolBar is a FocusScope, the focus of the controls in the toolbar isn't changed when clicking outside the toolbar. This is why the Button is still marked as focused even when moving the focus to the TextBox.

    In order to get over this you can either remove the focused state border from the RadToolBar elements or you can change the RadToolBar IsFocusScope setting:
    <telerik:RadToolBar FocusManager.IsFocusScope="False"/>

    Setting the attached property FocusManager.IsFocusScope to False will allow you to clear the focus of the RadToolBar elements when clicking outside the bar, but it can cause issues if you use ApplicationCommands.

    Basically when using application commands like Cut, Copy, Paste in a control that is in a focus scope, the commands can automatically detect the command target. However, if the RadToolBar isn't a focus scope and you want to define application commands for the bar's button controls, then you'll have to explicitly set the CommandTarget of the commands.

    Tina Stancheva
    the Telerik team

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

Back to Top