SelectionMode="Single"

<DataGridTemplateColumn Header="">
  <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
      <Button Content="更新"
          Tag="{Binding}">
        <Button.Style>
            <Style x:Name="ButtonVisibility">
            <Setter Property="Button.Visibility"
            Value="Hidden" />
            <Style.Triggers>
              <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}, Path=IsSelected}"
                Value="True">
                <Setter Property="Button.Visibility"
                Value="Visible" />
              </DataTrigger>
            </Style.Triggers>
           </Style>
        </Button.Style>
       </Button>
   </DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>

WPF DataGrid 增加"更新"模板列,根据行Row的选择而显示"更新"按钮的更多相关文章

  1. WPF DataGrid绑定一个组合列

    WPF DataGrid绑定一个组合列 前台: <Page.Resources>        <local:InfoConverter x:Key="converter& ...

  2. WPF DataGrid 获取选中 一行 或者 多行

    WPF中DataGrid使用时,需要将其SelectedItem转换成DataRowView进行操作 然而SelectedItem 与SelectedItems DataGrid的SelectionU ...

  3. 扩展jQuery easyui datagrid增加动态改变列编辑的类型

    $.extend($.fn.datagrid.methods, { addEditor : function(jq, param) { if (param instanceof Array) { $. ...

  4. WPF DataGrid DataGridTemplateColumn 控制模板中控件

    <DataGrid Name="DG">                <DataGrid.Columns>                    < ...

  5. WPF DataGrid 鼠标双击选中的DataGridRow及Row数据

    设置DataGrid的MouseDoubleClick事件 代码 //DataGrid鼠标双击事件 Private void dataGrid_MouseDoubleClick(object send ...

  6. PostgreSQL连接python,postgresql在python 连接,创建表,创建表内容,插入操作,选择操作,更新操作,删除操作。

    安装 PostgreSQL可以用Python psycopg2模块集成. sycopg2是Python编程语言的PostgreSQL数据库的适配器. 其程序代码少,速度快,稳定.不需要单独安装这个模块 ...

  7. Android 4.4 Kitkat Phone工作流程浅析(六)__InCallActivity显示更新流程

    本文来自http://blog.csdn.net/yihongyuelan 转载请务必注明出处 本文代码以MTK平台Android 4.4为分析对象,与Google原生AOSP有些许差异,请读者知悉. ...

  8. 编写 WPF DataGrid 列模板,实现更好的用户体验

    Julie Lerman 下载代码示例 最近我在为一个客户做一些 Windows Presentation Foundation (WPF) 方面的工作. 虽然我提倡使用第三方工具,但有时也会避免使用 ...

  9. WPF 中获取DataGrid 模板列中控件的对像

    WPF 中获取DataGrid 模板列中控件的对像 #region 当前选定行的TextBox获得焦点 /// <summary> /// 当前选定行的TextBox获得焦点 /// &l ...

随机推荐

  1. Hadoop2.6 Ha 安装

    Hadoop 2.6安装文档 版本说明:hadoop 2.6  linux-64位 Zookeeper3.4.6 jdk 1.7.0_75 1.       Ssh无密码 ssh-keygen vim ...

  2. apache下的IfModule里设置含义

    <IfModule mod_deflate.c> SetOutputFilter DEFLATE #必须的,就像一个开关一样,告诉apache对传输到浏览器的内容进行压缩 SetEnvIf ...

  3. 深入浅出—JAVA(6)

    6.认识JAVA的API Arraylist的操作

  4. DDB与DIB的区别

    DDB(设备相关位图) DDB依赖于具体设备:DDB的颜色模式必需与输出设备相一致.例如,如果当前的显示设备是256色模式,那么DDB必然也是256色的.在256色以下的位图中存储的像素值是系统调色板 ...

  5. uva11178 Morley’s Theorem(求三角形的角三分线围成三角形的点)

    Morley’s Theorem Input: Standard Input Output: Standard Output Morley’s theorem states that that the ...

  6. 在优化SQL语句中使用虚拟索引

    定义:虚拟索引(virtual index) 是指没有创建对应的物理段的索引. 虚拟索引的目的:是在不损耗主机CPU,IO,磁盘空间去实际创建索引的情况下,来判断一个索引是否能够对SQL优化起到作用. ...

  7. Physiological Processes of Speech Production--Reading Notes (8)

    Upper Jaw The upper jaw, or the maxilla with the upper teeth, is the structure fixed to the skull, f ...

  8. c++, 派生类的构造函数和析构函数 , [ 以及operator=不能被继承 or Not的探讨]

    说明:文章中关于operator=实现的示例,从语法上是对的,但逻辑和习惯上都是错误的. 参见另一篇专门探究operator=的文章:<c++,operator=>http://www.c ...

  9. application(CURD)--easyui

    一,效果图. 二,源代码. <!DOCTYPE html><html><head> <meta charset="UTF-8"> & ...

  10. javascript 学习随笔6

    改变html内容 document.getElementById("p1").innerHTML="New text!"; var element=docume ...