1
안녕하세요 프로그래머 실제로 DataGridvIew에 DataGridViewComboBoxCell이 있는데 CellContentClick 이벤트가 발생하면 조건이 true이면 DataGridViewComboBox 값을 변경해야합니다.CellContentClick 이벤트에서 DataGridviewComboBoxCell 값을 수동으로 선택하는 방법은 무엇입니까?
private void gridviewholiday_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
{
int row = e.RowIndex;
int colo = e.ColumnIndex;
/*=============== To Show The Details =====================*/
if (e.ColumnIndex == 4)
{
if (Convert.ToBoolean(gridviewholiday.Rows[e.RowIndex].Cells[0].Value))
{
if (Type == "CUS")
{
Type = test.colType;
if (Type == "NO")
{
ComboBox combo = (ComboBox)sender;
combo.SelectedIndex = 0;
}
}
}
을하지만, 콤보 상자에 DataGridView를 캐스팅하는 동안 오류를 제공합니다 : 내 코드는 다음과 같이 이동합니다.
도와주세요.