Hello Alexandre,
Thank you for writing back.
In order to change the focus to the second
RadDropDownList after selection from the AutoComplete of the first
RadDropDownList (pressing
Enter key), you may use the following code snippet:
private
void
Form1_Load(
object
sender, EventArgs e)
{
// TODO: This line of code loads data into the 'nwindDataSet1.Employees' table. You can move, or remove it, as needed.
this
.employeesTableAdapter.Fill(
this
.nwindDataSet1.Employees);
// TODO: This line of code loads data into the 'nwindDataSet.Customers' table. You can move, or remove it, as needed.
this
.customersTableAdapter.Fill(
this
.nwindDataSet.Customers);
this
.radDropDownList1.DisplayMember =
"ContactName"
;
this
.radDropDownList2.DisplayMember =
"LastName"
;
this
.radDropDownList1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
this
.radDropDownList2.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
this
.radDropDownList1.GotFocus += radDropDownList1_GotFocus;
this
.radDropDownList1.DropDownListElement.AutoCompleteSuggest.DropDownList.PopupClosed += radDropDownList1_PopupClosed;
}
bool
flag =
false
;
private
void
radDropDownList1_PopupClosed(
object
sender, RadPopupClosedEventArgs args)
{
if
(args.CloseReason == Telerik.WinControls.UI.RadPopupCloseReason.Keyboard)
{
flag =
true
;
this
.radDropDownList2.DropDownListElement.TextBox.TextBoxItem.HostedControl.Select();
}
}
private
void
radDropDownList1_GotFocus(
object
sender, EventArgs e)
{
if
(flag)
{
this
.radDropDownList2.DropDownListElement.TextBox.TextBoxItem.HostedControl.Select();
}
flag =
false
;
}
Please, find the attached video (drag and drop over the browser to play), demonstrating the implemented behaviour.
I hope this information helps. Should you have further questions, I would be glad to help.
Regards,
Desislava
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application.
Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>