本文介绍了wpf应用程序中的数据网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello Everyone
我在wpf中有一个datagrid。我在datagrid里面有一个按钮。我想在按钮上设置图像我如何设置图像
plz help ...
代码是
Hello Everyone
I have a datagrid in wpf .I have a button inside datagrid.I want to set an image on button how i set the image
plz help...
the code is
<DataGridTemplateColumn Header="Delete" Width="60">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="Delete" Click="DeleteButton_Click" ></Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
怎么样在删除按钮上设置图像
谢谢
how to set image on delete button
Thanks
推荐答案
<datagridtemplatecolumn header="Delete">
Width="60">
<datagridtemplatecolumn.celltemplate>
<datatemplate>
<button content="Delete" Click="DeleteButton_Click" >
<button.template>
<controltemplate>
<border horizontalalignment="Center">
VerticalAlignment="Center">
<image source="ImagePath">
Width="16"
Height="16" />
</image></border>
</controltemplate>
</button.template>
</button>
</datatemplate>
</datagridtemplatecolumn.celltemplate>
</datagridtemplatecolumn>
这篇关于wpf应用程序中的数据网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!