Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

wpf datagrid exit cel editing mode when validation error

$
0
0

I have a datagrid with validatesOndataerror on column enabled

I want to enable the changes of all row even if there is an error on one row.

I know that the dataGrid will not exit cell editing mode until the validation error is resolved but how can I change this.

I want that the row stay in error but the user can change other row.

<DataGrid.Columns>    <DataGridTextColumn  Binding="{Binding TCChannel}" Header="N° Voie &#xA;TC" IsReadOnly="True" ElementStyle="{StaticResource CenterText}" />    <DataGridComboBoxColumn   Header="TC affecté à la &#xA;zone de régulation"  SelectedItemBinding="{Binding TCZone , ValidatesOnDataErrors=True}">        <DataGridComboBoxColumn.ElementStyle>            <Style>                <Setter Property="ItemsControl.ItemsSource" Value="{Binding DataContext.ListZone, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}}" />            </Style>        </DataGridComboBoxColumn.ElementStyle>        <DataGridComboBoxColumn.EditingElementStyle>            <Style>                <Setter Property="ItemsControl.ItemsSource" Value="{Binding DataContext.ListZone, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}}" />            </Style>        </DataGridComboBoxColumn.EditingElementStyle>    </DataGridComboBoxColumn>    <DataGridComboBoxColumn   Header="N° Voie &#xA;instrument" SelectedItemBinding="{Binding InstrumentChannel,  ValidatesOnDataErrors=True}">        <DataGridComboBoxColumn.ElementStyle>            <Style>                <Setter Property="ItemsControl.ItemsSource" Value="{Binding DataContext.ListInstrumentChannel, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}}" />            </Style>        </DataGridComboBoxColumn.ElementStyle>        <DataGridComboBoxColumn.EditingElementStyle>            <Style>                <Setter Property="ItemsControl.ItemsSource" Value="{Binding DataContext.ListInstrumentChannel, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}}" />            </Style>        </DataGridComboBoxColumn.EditingElementStyle>    </DataGridComboBoxColumn></DataGrid.Columns>




Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>