C# Datagrid不会进入编辑模式

C# Datagrid不会进入编辑模式,c#,wpf,datagrid,C#,Wpf,Datagrid,有关于如何在wpf数据网格上使用编辑模式的教程吗?下面这个简单的网格似乎无法编辑注释列 <DataGrid x:Name="_myDataGrid" AutoGenerateColumns="False" IsReadOnly="True" ItemsSource="{Binding}" SelectionMode="Single" CanUserResizeColumns="False" CanUserResizeRows="False"> <Data

有关于如何在wpf数据网格上使用编辑模式的教程吗?下面这个简单的网格似乎无法编辑注释列

<DataGrid x:Name="_myDataGrid" AutoGenerateColumns="False" IsReadOnly="True" ItemsSource="{Binding}" SelectionMode="Single" CanUserResizeColumns="False" CanUserResizeRows="False">
            <DataGrid.RowHeaderStyle>
                <Style TargetType="DataGridRowHeader">
                    <Setter Property="Content" Value="{Binding doorNumber}" />
                    <Setter Property="MinWidth" Value="40" />
                    <Setter Property="Width" Value="Auto" />
                </Style>
            </DataGrid.RowHeaderStyle>
            <DataGrid.Columns>
                <DataGridTemplateColumn Header="Comment" MinWidth="100" Width="*" IsReadOnly="False">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding doorComment}" ToolTip="{Binding doorComment}" TextTrimming="CharacterEllipsis" IsHitTestVisible="False" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                    <DataGridTemplateColumn.CellEditingTemplate>
                        <DataTemplate>
                            <TextBox Text="{Binding doorComment}" TextWrapping="Wrap" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellEditingTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>
将IsReadOnly更改为True
IsReadOnly=False

如果您希望它可编辑,为什么IsReadOnly=True?因为我不是很聪明P