0
  <DataGrid x:Name="dataGrid"
            ItemsSource="{Binding}"
            AutoGenerateColumns="False"
            IsReadOnly='False'
            Margin="1,3,6,3"
            Height='135'
            Width='180'
            >
    <DataGrid.Columns>
      <DataGridTextColumn Header=" Numbers" Binding="{Binding name}" />
      <DataGridTextColumn Header=" Numbers" x:Name='Lnumber' Binding="{Binding Lilies_number}"   />
    </DataGrid.Columns>
  </DataGrid>

When I run the project , always , I have got [EditItem is not allowed for this view]

dataGrid.ItemsSource = Data.ctxSvc.GetAllTheLiLies();

KekoSha
  • 125
  • 13

1 Answers1

0

I found the anwer, when I added ,

            EnableRowVirtualization="True"

Is working fine,

  <DataGrid x:Name="dataGrid"
            EnableRowVirtualization="True"
            ItemsSource="{Binding}"
            AutoGenerateColumns="False"
            IsReadOnly='False'
            Margin="1,3,6,3"
            Height='135'
            Width='180'
            >
    <DataGrid.Columns>
      <DataGridTextColumn IsReadOnly='True' x:Name ='Lname'  Header=" Name " Binding="{Binding name}" />
      <DataGridTextColumn Header=" Numbers" x:Name='Lnumber' Binding="{Binding Lilies_number}"   />
    </DataGrid.Columns>
  </DataGrid>
KekoSha
  • 125
  • 13