I would like to expand a GridViewComboBoxColumn list on the same row where on another column that is set to "Lost".
(see attached screenshot)
(1) User clicks on a cell and selects "Lost" from a list
(2) From Cell Event, the "Reason" column (GridViewComboBoxColumn) is automatically expanded so the user knows to select a reason.
private void dgvSales_CellValidating(object sender, CellValidatingEventArgs e)
{
if(e.ColumnIndex >= 0 && e.RowIndex >= 0)
{
switch (e.ColumnIndex)
{
case int _ when e.ColumnIndex == dgvSales.Columns["colWonLost"].Index:
if(e.Value.ToString() == "Lost")
{
dgvSales.CurrentRow.Cells["colReason"].IsSelected = true;
//Add code here to expand colReason list
return;
}
break;
default:
break;
}
}
} //dgvSales CellValidating