XAML
<DataGrid
x:Name="dataGrid"
LoadingRow="dataGrid_LoadingRow"
Code
private void dataGrid_LoadingRow(object sender, DataGridRowEventArgs e)
{
// show
row number
e.Row.Header = (e.Row.GetIndex() +
1).ToString();
}