【发布时间】:2016-04-07 23:31:28
【问题描述】:
我有一个DataGridView 和一个DataGridViewComboBoxColumn。当我浏览任何单元格时,它们会突出显示。我的问题是当我浏览 ComboBoxColumn 单元格时,它们不会突出显示。这是我创建列的代码。
DataGridViewCellStyle GridStyleCombo = new DataGridViewCellStyle();
DataGridViewCell cell2 = new DataGridViewComboBoxCell();
DataGridViewComboBoxColumn col1 = new DataGridViewComboBoxColumn()
{
CellTemplate = cell2,
Name = "boundProfile",
HeaderText = "Promotion Bound Profile",
DataPropertyName = "BoundProfile",
DataSource = new BindingSource(DA.GetProfiles(), null),
FillWeight = 10,
AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill,
SortMode = DataGridViewColumnSortMode.Automatic,
DefaultCellStyle = GridStyleCombo,
DisplayMember = "Key",
ValueMember = "Value"
};
有没有办法以某种方式突出显示这些单元格?我已经尝试更改DataGridViewCell 或DataGridViewCellStyle 的选择颜色。
【问题讨论】:
标签: c# datagridview combobox selection-color