首页 > 代码库 > wpf DataGrid加载行号

wpf DataGrid加载行号

<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;        }

 

wpf DataGrid加载行号