Skip to main content
Home Forums General Silverlight New Features in Silverlight 3 Listbox ItemTemplate DataTemplate
2 replies. Latest Post by dipak_narsinghani on July 1, 2009.
(0)
dipak_na...
Member
0 points
2 Posts
07-01-2009 5:51 AM |
Hi,
I am using Silverlight 3 Beta ListBox control. Inside that Using ItemTemplate - DataTemplate.
I am not able to insert any control inside DataTemplate.
Thanks in advance.
jay nana...
Contributor
3388 points
624 Posts
07-01-2009 6:14 AM |
Try this code. it works.
<ListBox x:Name="mylist"> <ListBox.ItemTemplate> <DataTemplate> <Grid> <Button Content="{Binding}"></Button> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox>
and in code behind, just set ItemSource for example:
mylist.ItemsSource = "j a y".Split();
07-01-2009 6:23 AM |
Hi Jay,
Thanks for your reply.
I have just find out that it was intelisense problem with vs2008 IDE. After adding the Stack Panel or any other container control without getting intellisense, its working fine now.
Thanks again.............