0

I am developing a C# application using WPF. I needed a DataGrid to display a list of three text boxes. For that I used the editable grid from the Material Design demo, but when I run my app and add a row to the grid, whenever I click to edit the app stops and it says :

this app is on stop mode".

Here is my XAML code :

<DataGrid x:Name="DataGridTrait" Margin="6,462,451,24" ItemsSource="{Binding Treatement}" CanUserAddRows="True" CanUserDeleteRows="True" AutoGenerateColumns="False"   materialDesign:DataGridAssist.CellPadding="13 8 8 8" materialDesign:DataGridAssist.ColumnHeaderPadding="8" Grid.Row="1">
        <DataGrid.Columns>
            <DataGridTextColumn Binding="{Binding Traitement}" Header="Traitement"  EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}"/>
            <materialDesign:MaterialDataGridTextColumn Binding="{Binding Medicament}" Header="Medicament" MaxLength="255" EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}" />
            <materialDesign:MaterialDataGridTextColumn Binding="{Binding Dose}" Header="Dose" EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}" >

                <materialDesign:MaterialDataGridTextColumn.ElementStyle>
                    <Style TargetType="{x:Type TextBlock}">
                        <Setter Property="HorizontalAlignment" Value="Right"  />
                    </Style>
                </materialDesign:MaterialDataGridTextColumn.ElementStyle>
            </materialDesign:MaterialDataGridTextColumn>
            <DataGridTextColumn Binding="{Binding Indication}" Header="Indication" EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}" />
        </DataGrid.Columns>
        <DataGrid.Resources>
            <Style TargetType="DataGridCell">
                <Style.Triggers>
                    <Trigger Property="IsSelected" Value="True">
                        <Setter Property="Background" Value="DimGray" />
                    </Trigger>
                </Style.Triggers>
            </Style>
        </DataGrid.Resources>
    </DataGrid>
jps
  • 20,041
  • 15
  • 75
  • 79
Meriem
  • 1
  • 1
    Possible duplicate of [The application is in break mode - Unable to determine cause](https://stackoverflow.com/questions/46102963/the-application-is-in-break-mode-unable-to-determine-cause) – Kilazur Mar 30 '18 at 10:02
  • You should adopt an iterative approach to development. Rather than write a stack of markup then 3 hours later hit f5...Oh... there's a problem somewhere in those 1000 lines of XAML. Write a bit. Hit f5. Write a bit. Hit f5. When it breaks then you know it's the last iteration broke it. When you hit break mode like this there is often a more meaningful message lurking elsewhere like in the output window. Take a look around. If you find none then make this just a datagrid for now and see what happens without all the unique material design gubbins. – Andy Mar 30 '18 at 10:35

0 Answers0