79742296

Date: 2025-08-21 12:38:28
Score: 1
Natty:
Report link

Use the following event DataGrid.LoadingRow and attach it to the Data Grid.

Official documentation : https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.datagrid.loadingrow

<DataGrid x:Name="DataGrid"
          SelectedItem="{Binding SelectedSupplier, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
          ItemsSource="{Binding SuppliersList, Mode=OneWay}"
          AutoGenerateColumns="False"
          LoadingRow="DataGrid_LoadingRow">

Now define the function DataGrid_LoadingRow and then disable the row.

if (e.Row.GetIndex() == 0) e.Row.IsEnabled = false;
Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Rajeev KR