DataGrid DataGridTemplateColumn
设置单元格的样式
<DataGrid.Columns>
<DataGridTextColumn Header="检测项目" Binding="{Binding ItemName}" Width="*" />
<DataGridTemplateColumn Header="详细" Width="80" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button VerticalAlignment="Stretch" Style="{StaticResource NewDialogBtStyleG}" Height="{Binding ElementName=GridTest,Path=RowHeight}" Click="ItemClick" ></Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
效果:

DataGrid DataGridTemplateColumn的更多相关文章
- wpf mvvm datagrid DataGridTemplateColumn的绑定无效的可能原因之一!
昨天在mvvm wpf的开发中遇到一个问题,绑定不起作用,编辑阶段没问题也没有提示找不到对应的绑定,但是在运行之后却不起作用,查了很多资料,说法不一,有些是要删除datagrid的一行,直接绑定del ...
- WPF DataGrid DataGridTemplateColumn 控制模板中控件
<DataGrid Name="DG"> <DataGrid.Columns> < ...
- WPF学习目录
基本概念 数据源Source-目标Target WPF生命周期 App.xaml 依赖属性 WPF路由 线程操纵UI问题 利用属性中设置.查看DataContext/Command等 分析布局 写数据 ...
- WPF DataGrid自定义列DataGridTextColumn.ElementStyle和DataGridTemplateColumn.CellTemplate
<Window x:Class="DataGridExam.MainWindow" xmlns="http://schemas.microsoft.c ...
- MVVM框架下,WPF实现Datagrid里的全选和选择
最近的一个项目是用MVVM实现,在实现功能的时候,就会有一些东西,和以前有很大的区别,项目中就用到了常用的序号,就是在Datagrid里的一个字段,用checkbox来实现. 既然是MVVM,就要用到 ...
- 【原创】Silverlight DataGrid对核心控件DataGrid的任意单元格进行获取和设置分析。
前几天,公司同事有个需求需要对系统中的DataGrid控件的指定单元格(如图,申请人ID)进行禁用设置,尝试了很多次总是 整行整列的 禁用 没实现效果. 网上资料较少,没找到解决措施. 尽管silve ...
- WPF 显示文件列表中使用 ListBox 变到ListView 最后使用DataGrid
WPF 显示文件列表中使用 ListBox 变到ListView 最后使用DataGrid 故事背景: 需要检索某目录下文件,并列出来,提供选择和其他功能. 第一版需求: 列出文件供选择即可,代码如下 ...
- wpf 获取datagrid中模板中控件
//获取name为datagrid中第三列第一行模板的控件 FrameworkElement item = dataGrid.Columns[].GetCellContent(dataGrid.Ite ...
- 在WPF中获取DataGridTemplateColumn模板定义的内容控件
xaml格式描述: <DataGrid Name="dataGrid" Grid.Row="1" ItemsSource="{Binding}& ...
随机推荐
- hash_map原理及C++实现
一.数据结构:hash_map原理 hash_map基于hash table(哈希表).哈希表最大的长处,就是把数据的存储和查找消耗的时间大大减少,差点儿能够看成是常数时间:而代价不过消耗比較多的内 ...
- SocketChannel API用法
java.nio.channels 类 SocketChannel java.lang.Object java.nio.channels.spi.AbstractInterruptibleChanne ...
- php 上传文件大小控制配置文件中设置的
Windows 环境下的修改方法 ================================================================第一步:修改在php5下POST文件大 ...
- 序列 mysql
CREATE TABLE emp_seq (seq INT); INSERT INTO emp_seq VALUES(0); UPDATE emp_seq SET seq = LAST_INSERT_ ...
- 百度echart--Uncaught Error: Component series.wordCloud not exists. Load it first.
百度echart--Uncaught Error: Component series.wordCloud not exists. Load it first. 一.总结 一句话总结:关注报的错.可以通 ...
- [NPM] Pull out npm scripts into another file with p-s
A technique you might use once you start having lots of npm scripts is to use a node package that al ...
- CSU1323: ZZY and his little friends
Description zzy养了一只小怪兽和N只凹凸曼,单挑的话每只凹凸曼都不是小怪兽的对手,所以必须由两只凹凸曼合作来和小怪兽战斗.凹凸曼A和凹凸曼B合作的战斗力为他们战斗力的异或值.现在由zzy ...
- ios9 xcode7以后编译需要进行的几项设置
http://blog.csdn.net/hero82748274/article/details/48629461 1.库后缀变了:.dylib->tbd libsqlite3.0.dylib ...
- Thermal zone monitoring in an electronic device
FIELD One embodiment of the invention relates to a closed loop thermal control process in a portable ...
- 简单易用的动画animations
_tableView_selc.frame=CGRectMake(20, , 20,20); [UIView animateWithDuration:0.3f animations:^{ _table ...