DataPropertyNames를 설정하여 데이터 소스로 부분적으로 채워진 Datagridview를 사용하고 있습니다. 부분적으로 코드에서 나를 채웠습니다. DataGridViewComboBoxColumn은 옆에있는 버튼을 클릭 할 때 셀을 채워야하는 곳입니다. 버튼을 클릭하면 DataGridViewComboBoxCell의 항목이 채워지지만 ComboBox를 클릭하면 열어서 값을 선택할 수 없습니다.DataGridViewComboBoxCell의 새 항목이 표시되지 않습니다.
//add the combobox column
DataGridViewComboBoxColumn cellcol = new DataGridViewComboBoxColumn();
cellcol.Name = "Cell";
cellcol.ReadOnly = false;
dataGridView1.Columns.Add(cellcol);
//method that gets called when the button is clicked
private void getAllCells(List<ComponentRow> componentRows, int i)
{
//show all cells
CellFilter cf = new CellFilter();
cf.customerNr = libraryNr;
Cell[] cells = Service.Instance.Client.queryCells(cf, new QueryParam());
foreach (Cell c in cells)
{
((DataGridViewComboBoxCell)dataGridView1["Cell", i]).Items.Add(cells[0].cell_name);
}
cellsShownForComponents[i] = ShowedCells.ALL;
((DataGridViewTextBoxCell)dataGridView1["variants", i]).Value = "x";
}
을 편집 할 수 없습니다해야 다른 모든 열 사용자를위한 내 comboboxcolumn
의 DataGridView에
에 대한 을 * 내가 클릭하면 ComboBox에서 값을 선택하기 위해 열 수 없습니다. * -> 즉, 콤보 상자에 항목이 전혀 없으며 ComboBox를 두 번 클릭해야한다는 것을 의미합니다. 첫 번째는 활성화하고 두 번째는 AC입니다. 순식간에 그 명부를 삭제하십시오. –
콤보 상자에 항목이 들어 있습니다 (디버깅을 통해 확인했습니다). 두 번 클릭해도 작동하지 않습니다. 나는 click-eventhandler가 datagridview에 구현되어 있지만 다른 셀에서는 여전히 정상적으로 동작하므로 comboboxcolumn에 대해 정상적으로 작동하지 않는 이유는 알 수 없습니다. – RazorEater