2012-09-11 10:55

 

在datagrid中添加一个模板列,xaml内容如下:

<DataGridTemplateColumn Header="头像" Width="SizeToCells" IsReadOnly="True">

                                <DataGridTemplateColumn.CellTemplate>

                                    <DataTemplate>

                                        <Image Height="40"  Source="{Binding Path=PHOTO}"  />

                                    </DataTemplate>

                                </DataGridTemplateColumn.CellTemplate>

                            </DataGridTemplateColumn>


注意:其中的Source="{Binding Path=PHOTO}",就是这一句起到了作用,PHOTO就是数据表中的列名。

相关文章:

  • 2022-02-14
  • 2021-10-06
  • 2022-12-23
  • 2022-12-23
  • 2021-04-06
  • 2021-05-25
  • 2021-06-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2022-12-23
相关资源
相似解决方案