提出问题提出问题
 

问题How can I focus a particular item in ListBox in WPF

  • 2009年5月20日 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.