Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
5520
select item just after setting itemssource
posted

Hi,

i have a tree. i am setting the itemsSource and i want to select the first item directly.

i tried after setting the itemssource. it's not working. if i add a button that selects the item its working fine.

 tree.SelectItem(tree.Items[0]);

(tree.Items[0] is not null) 

i also tried to go into a loop 

While(tree.SelectedItem == null)

 tree.SelectItem(tree.Items[0]);

 

it 's not working. any suggestions plz