I have to add two columns in a ListView
. One column shows different Image
s and another column is used to show a Button
.
It will be great help if anybody provide the any link or example source code. Thanks in advance.
This would give you two columns one with a button one with an image. if i was doing it i would put a command on my item so i could bind my button to it.
<ListView
Name="myListView">
<ListView.View>
<GridView>
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<Button
Content="Click Me"
Margin="0"
VerticalAlignment="Center"
Click="Button_Click" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<Image
Source="{Binding ImageSource}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
You would need to have an items source containing items that have a property called ImageSource
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With