I would have a look at this WPF horizontal Datagrid answer taking advantage of <RotateTransform Angle="-90"/>
to pivot your DataGrid.
Below is the copied XAML answer @dimaKudr
<DataGrid.LayoutTransform>
<TransformGroup>
<RotateTransform Angle="-90"/>
<ScaleTransform ScaleX="1" ScaleY="-1" />
</TransformGroup>
</DataGrid.LayoutTransform>
<DataGrid.ColumnHeaderStyle>
<Style TargetType="{x:Type DataGridColumnHeader}"
BasedOn="{StaticResource {x:Type DataGridColumnHeader}}">
<Setter Property="LayoutTransform">
<Setter.Value>
<TransformGroup>
<RotateTransform Angle="-90"/>
<ScaleTransform ScaleX="1" ScaleY="-1" />
</TransformGroup>
</Setter.Value>
</Setter>
</Style>
</DataGrid.ColumnHeaderStyle>
Afterwards, I'd have a look at creating a DataGridTemplateColumn
and use a CellTemplate
with a CheckBox
inside binding to your Flag property, using a Converter to convert the 0 and 1 to true/false
<DataGrid>
<DataGrid.Columns>
<DataGridTemplateColumn x:Name="FlagColumn" Header="Flag" Width="25" IsReadOnly="False">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<CheckBox IsChecked="{Binding Flag, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource FlagConverter}" />
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>