DataGridView 自增行序列

 DataSet ds_File=bll_FileListInfo.GetList(i_FileListID);
            DataTable table = new DataTable();
            DataColumn column = new DataColumn();
            column.ColumnName = "Autoid";
            column.AutoIncrement = true;
            column.AutoIncrementSeed = 1;
            column.AutoIncrementStep = 1;
            table.Columns.Add(column);
            table.Merge(ds_File.Tables[0]);
            //dgv_FileList.DataSource = ds_File.Tables[0];
            dgv_FileList.DataSource = table;

你可能感兴趣的:(datagridview)