如何将图像放在gridview中的特定单元格中 [英] how to put image in specific cell in gridview
本文介绍了如何将图像放在gridview中的特定单元格中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
没有人想帮助我吗?
亲爱的
解决方案
试试这个
< pre class ="prettyprint">< DataGrid ItemsSource =" {Binding Customers}"的AutoGenerateColumns = QUOT假QUOT; >
< DataGrid.Columns>
< DataGridTemplateColumn Header =" Image"宽度= QUOT; SizeToCells" IsReadOnly = QUOT;真">
< DataGridTemplateColumn.CellTemplate>
< DataTemplate>
< Image Source =" {Binding Image}" />
< / DataTemplate>
< /DataGridTemplateColumn.CellTemplate>
< / DataGridTemplateColumn>
< /DataGrid.Columns>
< / DataGrid>
No one wants to help me?
honey
解决方案
try this<DataGrid ItemsSource="{Binding Customers}" AutoGenerateColumns="False" > <DataGrid.Columns> <DataGridTemplateColumn Header="Image" Width="SizeToCells" IsReadOnly="True"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <Image Source="{Binding Image}" /> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> </DataGrid.Columns> </DataGrid>
这篇关于如何将图像放在gridview中的特定单元格中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文