开发者

Getting ListBox Items Silverlight

开发者 https://www.devze.com 2023-01-18 13:32 出处:网络
I have tried to get the listbox items using VisualTre开发者_运维知识库eHelper class. When I do VisualTreeHelper.GetChildrenCount((DependencyProperty)listBox1) it returns count as 0. But the listbox ha

I have tried to get the listbox items using VisualTre开发者_运维知识库eHelper class. When I do VisualTreeHelper.GetChildrenCount((DependencyProperty)listBox1) it returns count as 0. But the listbox has lot of listboxitems in it.Can someone let me know if I am doing any mistake?

Regards, Lalith


Have you tried to use the ItemContainerGenerator property of the Listbox class ? It has some methods you can use to retrieve Listbox items. http://msdn.microsoft.com/en-US/library/system.windows.controls.itemscontrol.itemcontainergenerator(v=VS.95).aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消