To reproduce
1. Run the code.
2. Open dropdown list
Observed:
Dropdown list width is same as column width
Expected:
Dropdown list width must be greater than column width
How to make dropdown list width greater than column width in DataGridView ?
using System;
using System.Windows.Forms;
class Form1 : Form {
[STAThread]
static void Main() {
try {
Application.Run(new Form1());
}
catch (Exception e) {
MessageBox.Show(e.ToString());
}
}
private DataGridView dataGridView1 = new DataGridView();
public Form1() {
Controls.Add(this.dataGridView1);
Load += new EventHandler(Form1_Load);
}
private void Form1_Load(object sender, EventArgs e) {
DataGridViewComboBoxColumn
col = new DataGridViewComboBoxColumn();
col.DropDownWidth *= 3;
dataGridView1.Columns.Add(col);
}
}
Andrus