WPF DATAGrid background binding blank column column processing

Original: WPF binding the DataGrid column blank columns background processing

 

AutoGenerateColumns


  
  
  1. <DataGrid x:Name= "dataGrid" Margin= "10,10,0,0" RowHeaderStyle= "{DynamicResource DataGridRowHeaderStyle1}" >
  2. <DataGrid.Columns>
  3. <DataGridTextColumn Header= "姓名" Binding= "{Binding Name}"></DataGridTextColumn>
  4. </DataGrid.Columns>
  5. </DataGrid>

This line is the code name from the interface background is bound to name num class job

Plus AutoGenerateColumns = "false" dynamically loaded will not show background

 

HorizontalAlignment = "Left" blank column processing

This annoying very very unhappy

Plus HorizontalAlignment = "Left" can be disposed of

 

CanUserAddRows = "False" CanUserResizeRows = "false" is generated dynamically add rows to see the effect before you decide to do

Guess you like

Origin www.cnblogs.com/lonelyxmas/p/12075391.html