1. 程式人生 > >WPF DataGridTextColum 顯示時間格式化

WPF DataGridTextColum 顯示時間格式化

room etime tex pos extc 時間格式 color binding grid

 1 <DataGrid Name="DGVisit" Grid.Row="2" AutoGenerateColumns="False" CanUserAddRows="False" IsReadOnly="True" >
 2                         <DataGrid.Columns>
 3                             <DataGridTextColumn Header="" Binding="{Binding Id}" MinWidth="110"/>
 4                             <
DataGridTextColumn Header="房間號" Binding="{Binding VisitRoomNum}" MinWidth="250"/> 5 <DataGridTextColumn Header="房間類型" Binding="{Binding VisitRoom}" MinWidth="300"/> 6 <DataGridTextColumn Header="訪問人員" Binding="{Binding VisitorName}" MinWidth
="400"/> 7 <DataGridTextColumn Header="進入房間時間" Binding="{Binding Path=CreateTime,StringFormat=‘yyyy年MM月dd日 HH:mm:ss‘}" MinWidth="300" /> 8 <DataGridTextColumn Header="離開房間時間" MinWidth="300"/> 9 </DataGrid.Columns
> 10 </DataGrid>

WPF DataGridTextColum 顯示時間格式化