2012-04-17 9 views

答えて

4
<DataGrid ... 
    <DataGrid.CellStyle> 
     <Style TargetType="DataGridCell"> 
      <Setter Property="Width" Value="100"/> 
      <Setter Property="Height" Value="50"/> 
     </Style> 
    </DataGrid.CellStyle> 
1

はこのような何かを試してみてください:

<!--you can set Name and ItemsSource to other values, this is just a sample--> 
    <DataGrid x:Name="dataGrid" ItemsSource="{Binding}"> 
     <DataGrid.CellStyle> 
      <Style TargetType="DataGridCell"> 
       <Setter Property="Width" Value="100"/> 
       <Setter Property="Height" Value="50"/> 
      </Style> 
     </DataGrid.CellStyle> 
    </DataGrid> 
1

あなたはcolumnWidthのとがRowHeightを設定しようとしたことがありますか?データグリッドのスタイリングに

<DataGrid ColumnWidth="100" RowHeight="50"/> 

詳細情報は Styling Microsoft’s WPF datagridで見つけることができます。

+0

壊れたリンクを修正してください。 – LPL

関連する問題