Cues not shown on RadioButtons

4 posts, 0 answers
  1. Roberto Wenzel
    Roberto Wenzel avatar
    41 posts
    Member since:
    Sep 2012

    Posted 08 Apr 2011 Link to this post

    Hello,
    maybe somone can help me with this little problem.
    I have a Groupbox with several RadioButtens in it. Then I added a RadShortCut to the GroupBox and I want the first RadioButton in that GroupBox to be focused.
    This works in principle, the RadioButton gets the focus, but the cues are not shown for the focused RadioButton. This is not the expected behaviour, so the user cannot see that he has entered the GroupBox.
    Only when using the TAB key to move to the GroupBox the cues are shown. I want to show the cues programmatically. Is there an option to do that?
    I used the following code:
    Imports Telerik.WinControls
    Public Class Test4
         Private Sub Test4_Load(ByVal sender As ObjectByVal e As System.EventArgsHandles Me.Load
            ThemeResolutionService.ApplicationThemeName = "Desert"
             RadGroupBox1.HeaderText = "<html><u>R</u>adGroupBox1"
            RadGroupBox1.RootElement.Shortcuts.Add(New RadShortcut(Keys.Alt, Keys.R))
            AddHandler RadGroupBox1.RootElement.Click, AddressOf RadGroupBox1_Click
        End Sub
         Private Sub RadGroupBox1_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles RadGroupBox1.Click
            RadRadioButton1.Focus()
        End Sub
    End Class

    Thank you for any hint.
    Cheers Roberto
  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 13 Apr 2011 Link to this post

    Hello Roberto Wenzel,

    Thank you for writing.

    This is a known issue which is already logged into our PITS system and we will address it in one of our future releases.

    Meanwhile, you can inherit the RadRadioButton control and override its ShowFocusCues property to work around the issue. In addition, you should override the ThemeClassName property in order to enable themes for the inherited control:

    Public Class FocusCueButton
        Inherits RadRadioButton
     
        Protected Overrides ReadOnly Property ShowFocusCues As Boolean
            Get
                Return True
            End Get
        End Property
     
        Public Overrides Property ThemeClassName() As String
            Get
                Return GetType(RadRadioButton).FullName
            End Get
            Set(ByVal value As String)
     
            End Set
        End Property
    End Class

    Please let me know if this works for you.

    Best wishes,
    Stefan
    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Roberto Wenzel
    Roberto Wenzel avatar
    41 posts
    Member since:
    Sep 2012

    Posted 15 Apr 2011 Link to this post

    Hello Stefan,
    thank you very much for your help.
    Yes, Your solution works in general. Unfortunatelly I already have dozens of RadioButtons with handlers and code behind etc.
    It would be a lot of work to recreate everything. Maybe I wait for an official fix. Or is there a possibilty to convert my existing RadioButtons to the new 'FocusCueButton' ?
    Cheers Roberto
  5. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 20 Apr 2011 Link to this post

    Hi Roberto,

    The easiest option in this case is to do a multiple Find - Replace in your project and replace all radio buttons with a FocusCueButton. Like Stefan said, this issue will be addressed in one of our upcoming releases.

    If you have any other questions, do not hesitate to contact us.
     
    Regards,
    Jack
    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
Back to Top