none
Problem With Horizontal DataGrid RRS feed

  • Question

  • I have Implement this Code But the Cells Text has a different behaviour

    <DataGrid Name="dgRemplacement" Uid="dgRemplacement" IsReadOnly="True">
       <DataGrid.Columns>
          <DataGridTextColumn Header="Article(Serie)" Binding="{Binding Designation}"/>
          <DataGridTextColumn Header="Qte" Binding="{Binding Qte}"/>
       </DataGrid.Columns>
       <DataGrid.LayoutTransform>
          <TransformGroup>
              <RotateTransform Angle="-90"/>
          </TransformGroup>
       </DataGrid.LayoutTransform>
       <DataGrid.ColumnHeaderStyle>
          <Style TargetType="{x:Type DataGridColumnHeader}" BasedOn="{StaticResource {x:Type DataGridColumnHeader}}">
                <Setter Property="LayoutTransform">
                        <Setter.Value>
                            <TransformGroup>
                                    <RotateTransform Angle="90"/>
                              </TransformGroup>
                        </Setter.Value>
              </Setter>
          </Style>
      </DataGrid.ColumnHeaderStyle>
    </DataGrid>

    as the output result 

    http://img859.imageshack.us/i/dghor.png/

    mercredi 20 avril 2011 08:54

Réponses

  • Bonjour,

    Je ne suis pas très doué en anglais, donc veuillez m'excuser pour ce qui va suivre ^^.

    Hello, I apologize in advance for my English.
    I found a solution more or less clean.

    Here's the XAML :

    <DataGrid Name="dgRemplacement" Uid="dgRemplacement" IsReadOnly="True" AutoGenerateColumns="False" VerticalAlignment="Top" >
          <DataGrid.Columns>
            <DataGridTextColumn Header="Article(Serie)" Binding="{Binding Designation}" />
            <DataGridTextColumn Header="Qte" Binding="{Binding Qte}"/>
          </DataGrid.Columns>
          <DataGrid.LayoutTransform>
            <TransformGroup>
              <RotateTransform Angle="-90"/>
            </TransformGroup>
          </DataGrid.LayoutTransform>
          <DataGrid.ColumnHeaderStyle>
            <Style TargetType="{x:Type DataGridColumnHeader}" BasedOn="{StaticResource {x:Type DataGridColumnHeader}}">
              
              <Setter Property="LayoutTransform">
                <Setter.Value>
                  <TransformGroup>
                    <RotateTransform Angle="90"/>
                  </TransformGroup>
                </Setter.Value>
              </Setter>
            </Style>
          </DataGrid.ColumnHeaderStyle>
          <DataGrid.CellStyle>
            <Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource {x:Type DataGridCell}}">
              
              <Setter Property="LayoutTransform">
                <Setter.Value>
                  <TransformGroup>
                    <RotateTransform Angle="90"/>
                  </TransformGroup>
                </Setter.Value>
              </Setter>
            </Style>
          </DataGrid.CellStyle>
        </DataGrid>
    

     


    Cordialement, Pascal.

    Développeur Wpf/SilverLight/WinPhone7

    samedi 23 avril 2011 12:57
    Modérateur