<DataGrid Name="tkdg" HorizontalContentAlignment="Center" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False"
LoadingRow="tkdg_LoadingRow"> 。。。。。
后台直接
private void tkdg_LoadingRow(object sender, DataGridRowEventArgs e) { //加载行 e.Row.Header = e.Row.GetIndex() + 1; }