if (dgvRecord.Grid.DisplayLayout.Bands[0].Columns.Exists(nameof(DrugInout.DgInfo)) == true) { dgvRecord.Grid.DisplayLayout.Bands[0].Columns[nameof(DrugInout.DgInfo)].Header.Fixed = true; }
实现效果