这是前台程序
<DataGrid
Height="745" Width="956" HorizontalAlignment="Left" Margin="279,24,0,0" Name="dataGrid1" VerticalAlignment="Top"
AutoGenerateColumns="False"
IsReadOnly="True" FontFamily="Adobe Song Std" FontSize="15" FontWeight="Black"
IsManipulationEnabled="False" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" SelectionMode="Single" Canvas.Left="-183" Canvas.Top="-92">
<!--设置列关键字类型-->
<DataGrid.ColumnHeaderStyle>
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center">
</Setter>
</Style>
</DataGrid.ColumnHeaderStyle>
<!--设置行头类型-->
<DataGrid.RowHeaderStyle>
<Style TargetType="DataGridRowHeader">
<Setter Property="Content" Value="*"/>
<Setter Property="Width" Value="20"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="White" Offset="0"/>
<GradientStop Color="#FF9D9D9D" Offset="0.5"/>
<GradientStop Color="White" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="ToolTip" Value="Select this Row"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowHeaderStyle>
<!--设置行类型-->
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="Background" Value="LightBlue" />
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="LightGray"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<!--设置列显示内容类型-->
<DataGrid.Columns>
<DataGridTextColumn Header="序号" Width="50" Binding="{Binding XH,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
<DataGridTemplateColumn Header="照
片" Width="150"
IsReadOnly="True" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image Height="80"
Source="{Binding ZP,Mode=OneWay}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<!--设置-->
<DataGridColumn.HeaderStyle>
<Style TargetType="DataGridColumnHeader">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="White" Offset="0"/>
<GradientStop Color="#FF9D9D9D" Offset="0.5"/>
<GradientStop Color="White" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
</Style>
</DataGridColumn.HeaderStyle>
</DataGridTemplateColumn>
<DataGridTextColumn Header="姓
名" Width="150" Binding="{Binding XM,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
</DataGridTextColumn>
<DataGridTextColumn Header="门卡编号" Width="150" Binding="{Binding MKBH, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
<DataGridTextColumn Header="工
号" Width="150" Binding="{Binding GH, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
<DataGridTextColumn Header="部门名称" Width="150" Binding="{Binding BMMC, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
<DataGridTextColumn Header="考勤管理" Width="70" Binding="{Binding KQGL, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
<DataGridTextColumn Header="门禁管理" Width="70" Binding="{Binding MJGL,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataGrid.Columns>
</DataGrid>