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

commandbardropdownlist focus

2 Answers 88 Views
CommandBar
This is a migrated thread and some comments may be shown as answers.
ricric
Top achievements
Rank 1
ricric asked on 02 Mar 2011, 04:58 PM
i have use CommandBarDropDownList1.DropDownListElement.EditableElement.TextBox.Focus() on form load, but the dropdownlist still can't focus. any solution?

2 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 02 Mar 2011, 05:23 PM
Hello,

If your DropDownStyle is set to DropDown, then this will do the trick for you

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Me.CommandBarDropDownList1.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown
End Sub
Private Sub Form1_Shown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Shown
    Me.CommandBarDropDownList1.DropDownListElement.TextBox.TextBoxItem.HideSelection = False
    Me.CommandBarDropDownList1.DropDownListElement.TextBox.TextBoxItem.SelectAll()
    Me.CommandBarDropDownList1.DropDownListElement.Focus()
End Sub

Hope that helps but let me know if you have any questions
Richard
0
ricric
Top achievements
Rank 1
answered on 03 Mar 2011, 08:57 AM
Thank you so much.
Tags
CommandBar
Asked by
ricric
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
ricric
Top achievements
Rank 1
Share this question
or