항상 적어도 하나의 행을 항상 선택하는 것으로 보이는 winforms datagridview가 있습니다. 나는 정말로 열을 선택할 수있는 것에 관심이 없다. 사용자가 열 1의 체크 박스를 선택할 수 있어야한다. 왜 항상 적어도 1 개의 행이 선택된가? 어떻게 방지 할 수 있습니까? column1의 확인란을 선택하는 기능에 영향을 줍니까?C# WinForms DataGridView - 상수 행 선택!
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
this.dataGridView1.DefaultCellStyle.ForeColor = Color.Black;
this.dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
this.dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
this.dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
this.dataGridView1.MultiSelect = false;
this.dataGridView1.RowHeadersVisible = false;
this.dataGridView1.RowsDefaultCellStyle.BackColor = Color.WhiteSmoke;
this.dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.LightGray;
this.dataGridView1.ColumnCount = 0;
colSelect = new DataGridViewCheckBoxColumn();
colSelect.HeaderText = "Select Message";
colSelect.Width = 90;
this.dataGridView1.Columns.Insert(0, colSelect);
this.dataGridView1.Columns[0].DataPropertyName = "msgSelect";
정확하지 않은지 ........ – Goober
정말요? 선택한 행이 하나 인 이유는 이것이 선택 모드가로 설정 되었기 때문입니다! 그러므로 "한 줄"을 선택하지 않으려면 그것을 바꿀 필요가 있습니다. – Calanus
나는 당신이 질문 Calanus를 이해했다고 생각하지 않습니다. 그는 DataGridView가 기본적으로 목록의 첫 번째 행을 선택하는 것을 중단 할 수있는 방법을 알고 싶어합니다. – James