Focus on RadListBoxItem is not working

0 Answers 8 Views
ListBox
Marvin
Top achievements
Rank 1
Marvin asked on 28 Mar 2024, 02:57 PM

Hello, 

im trying to set the focus on a ListBoxItem so the User can navigate to the next Index by pressing the down button.

Our current implementation is that the focus is set on the RadListBox itself and not on the item but you need to double press down to get the second item.

Is there some way to set the focus on the items itself rather than the ListBox?

I already tried something like this but this is not working.
 if (ListBox.SelectedItem != null)
 {
     var item = ListBox.ItemContainerGenerator.ContainerFromIndex(ListBox.SelectedIndex);
     if(item != null)
     {
         ((RadListBoxItem)item).Focus();
     }
     else
     {
         ListBox.Focus();
     }
 }

No answers yet. Maybe you can help?

Tags
ListBox
Asked by
Marvin
Top achievements
Rank 1
Share this question
or