Hi:
I have a radcombobox (cboSpecialty) and below it a ListBox. When I select a specialty, the physicians with that specialty (and a picture) appear in the ListBox, where I automatically select the first one. When I click on a physician in the listbox, his/her detailed bio appears. When I hit up-arrow or down-arrow, I navigate to a different physician bio. That all works great.
The problem is that even thoughI have selected the first item in the listbox, the combobox retains focus. When the user wants to view the next physician, he/she hits the down-arrow. But instead of changing the selection in the listbox, the combobox is moved to the next specialty and all of the physicians in the listbox change.
I thought the simple solution was to change the focus to the listbox inside the SelectionChanged event, but it doesn't work. The focus remains on the combobox.
I don't know if this is a radcombobox issue or a silverlight issue. If I could just disable keyboard input to the combobox, I'd be OK with that. Can you help? The code is below. The Focus() call isn't working.
I have a radcombobox (cboSpecialty) and below it a ListBox. When I select a specialty, the physicians with that specialty (and a picture) appear in the ListBox, where I automatically select the first one. When I click on a physician in the listbox, his/her detailed bio appears. When I hit up-arrow or down-arrow, I navigate to a different physician bio. That all works great.
The problem is that even thoughI have selected the first item in the listbox, the combobox retains focus. When the user wants to view the next physician, he/she hits the down-arrow. But instead of changing the selection in the listbox, the combobox is moved to the next specialty and all of the physicians in the listbox change.
I thought the simple solution was to change the focus to the listbox inside the SelectionChanged event, but it doesn't work. The focus remains on the combobox.
I don't know if this is a radcombobox issue or a silverlight issue. If I could just disable keyboard input to the combobox, I'd be OK with that. Can you help? The code is below. The Focus() call isn't working.
private void cboSpecialty_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e) |
{ |
if( cboSpecialty.SelectedValue.Equals( "<All Physicians>" ) ) |
{ |
lstName.ItemsSource = from p in pdc.Physicians |
orderby p.LastName, p.FirstName, p.MiddleName |
select p; |
} |
else |
{ |
lstName.ItemsSource = from p in pdc.Physicians |
where p.Specialties.Any( x => x.Specialty == cboSpecialty.SelectedValue.ToString() ) |
select p; |
} |
if (lstName.Items.Count > 0) |
{ |
lstName.SelectedIndex = 0; |
lstName.Focus(); // remove focus from cboSpecialty so it won't change value on down-arrow |
} |
} |