0
votes

I have a WPF datagrid which has 4 columns, all of those are datagrid template columns. When the grid renders there is a column added automatically on the left, which I understand is used for displaying row validation errors and it's bound by a template RowValidationErrorTemplate.

My question is, I dont want this column to be displayed, and want this to be hidden. How can I set this on my datagrid?

Please note that I'm using .NET 3.5.

My grid style below:

 <Style x:Key="GridStyle" TargetType="{x:Type Controls:DataGrid}">
                <Setter Property="VerticalGridLinesBrush" Value="#7BA0CD"/>
                <Setter Property="HorizontalGridLinesBrush" Value="#7BA0CD"/>
                <Setter Property="AlternatingRowBackground" Value="#D3DFEE"/>
                <Setter Property="CanUserResizeRows" Value="False"/>
                <Setter Property="CanUserReorderColumns" Value="False"/>
                <Setter Property="CanUserResizeColumns" Value="False"/>
                <Setter Property="CanUserSortColumns" Value="False"/>
                <Setter Property="AutoGenerateColumns" Value="False"/>
            </Style>
1
Check this stack overflow link [Link][1] [1]: stackoverflow.com/questions/8394829/hide-wpf-datagrid-row-errorKurubaran

1 Answers

0
votes

Found how to do this:

<Setter Property="RowHeaderStyle">
            <Setter.Value>
                <Style TargetType="Primitives:DataGridRowHeader">
                    <Setter Property="Background" Value="Transparent" />
                </Style>
            </Setter.Value>
        </Setter>