列表视图绑定
我将我的列(状态)绑定到值。但我需要显示每个值的图像。 例如,“状态”列的值为:0, 1, 2, 0, 1, 1,0 因此,每个值都应该对应于图像。我想看的不是价值,而是形象! 我怎样才能做到这一点? 请帮我。
<GridView>
<GridView.ColumnHeaderContainerStyle>
<Style>
<Setter Property="FrameworkElement.Visibility" Value="Collapsed"/>
</Style>
</GridView.ColumnHeaderContainerStyle>
<GridViewColumn Header="ID" Width="0" DisplayMemberBinding="{Binding ID}" />
<GridViewColumn Header="Login" Width="90" DisplayMemberBinding="{Binding Login}" />
<GridViewColumn Width="65" Header="Status" DisplayMemberBinding="{Binding UserStatus}">
</GridViewColumn>
</GridView>
I binded my column (Status) to value. But I need to show image for each values.
For example, Status column has values : 0, 1, 2, 0, 1, 1,0
So, for each values should correspond to the image. I want to see not value, but image!!!
How I can do this ?
please help me.
<GridView>
<GridView.ColumnHeaderContainerStyle>
<Style>
<Setter Property="FrameworkElement.Visibility" Value="Collapsed"/>
</Style>
</GridView.ColumnHeaderContainerStyle>
<GridViewColumn Header="ID" Width="0" DisplayMemberBinding="{Binding ID}" />
<GridViewColumn Header="Login" Width="90" DisplayMemberBinding="{Binding Login}" />
<GridViewColumn Width="65" Header="Status" DisplayMemberBinding="{Binding UserStatus}">
</GridViewColumn>
</GridView>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要使用 Itemtemplate
可以在此处找到示例
http://huydinhpham.blogspot.com/2008/11/using-listvew-to-display-complex-data.html
You might need to use the Itemtemplate
An example can be found here
http://huydinhpham.blogspot.com/2008/11/using-listvew-to-display-complex-data.html