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

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>
上一篇:如何使用ORACLE(OCI)在SQL / PHP中进行更新查询


下一篇:PHP oci_connect()卡住了/没有超时