FlexGrid for WPF | ComponentOne
Features / Transpose Data in Grid
In This Topic
    Transpose Data in Grid
    In This Topic

    In FlexGrid control, the transpose feature flips the rows and columns so that the headers display on the left side and rows display across the screen. Transposed layouts are especially useful for comparing items, or displaying few data items in which each items has many properties. In FlexGrid, the transposed behavior can be simply enabled by using the TransposedGridBehavior class. The following image shows transpose behavior in FlexGrid control:

    Transpose Grid

    Perform the following steps to use the transpose feature in flexgrid control

    1. Add the following code in the XAML view to display transpose of rows into columns in the FlexGrid control:
      XAML
      Copy Code
      <c1:FlexGrid x:Name="grid">
          <i:Interaction.Behaviors>
              <c1:TransposedGridBehavior/>
          </i:Interaction.Behaviors>
      </c1:FlexGrid>
      
    2. Switch to code view and add the following code to bind FlexGrid control with datasource:
      C#
      Copy Code
      grid.ItemsSource = Customer.GetCustomerList(100);
      grid.MinColumnWidth = 85;