I am doing my first Windows Phone 7 application. It looks like DataGrid is not supported there. I am trying to find work around.
I do have such ListBox:
<ListBox x:Name="myListBox" Grid.Row="3">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Image Name="assetImage" Grid.Column="0" />
<TextBlock Name="assetId" Grid.Column="1" />
<TextBlock Name="market" Grid.Column="2" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
How do I set ItemsSource for such kind of list?
Let’s say I have List<MyObject> { string uri; string assetid; string market;}
Thanks!
Do this (adding bindings in your elements):
Now add the following code at the point where you want to create binding:
I assume that
MyObjectis a class withuri,assetidandmarketas properties andmyObjectsis aList<>with items of the typeMyObject.