Задайте вопросЗадайте вопрос
 

ВопросHow can I focus a particular item in ListBox in WPF

  • 20 мая 2009 г. 9:59narmishaba Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     
    Hi,

      I have a listBox whose elements are binded using ItemsSouce.
    Now in the code behind I want to move the focus to the 3rd item in the listbox.
    Can somone tell me as to how can I acheive this?
    I think that once we get the access to listboxItem than we can easily set the focus by calling <listboxitem>.Focus(). But now the question is how can I get a particular ListBoxItem object for a binded ListBox?

    Even though it looked quite obvious to me, I didnt found a solution.