private void bValueExpr_Click(object sender, System.EventArgs e) { if (dgFilters.CurrentCell == null) { dgFilters.Rows.Add("", "Equal", ""); } DataGridViewCell dgc = dgFilters.CurrentCell; int cc = dgc.ColumnIndex; string cv = dgc.Value as string; if (cc == 1) { // This is the FilterOperator DialogFilterOperator fo = new DialogFilterOperator(cv); try { DialogResult dlgr = fo.ShowDialog(); if (dlgr == DialogResult.OK) { dgc.Value = fo.Operator; } } finally { fo.Dispose(); } } else { DialogExprEditor ee = new DialogExprEditor(_Draw, cv, _FilterParent, false); try { DialogResult dlgr = ee.ShowDialog(); if (dlgr == DialogResult.OK) { dgc.Value = ee.Expression; } } finally { ee.Dispose(); } } }
private void bValueExpr_Click(object sender, System.EventArgs e) { if (dgFilters.CurrentCell == null) dgFilters.Rows.Add("", "Equal", ""); DataGridViewCell dgc = dgFilters.CurrentCell; int cc = dgc.ColumnIndex; string cv = dgc.Value as string; if (cc == 1) { // This is the FilterOperator DialogFilterOperator fo = new DialogFilterOperator(cv); try { DialogResult dlgr = fo.ShowDialog(); if (dlgr == DialogResult.OK) dgc.Value = fo.Operator; } finally { fo.Dispose(); } } else { DialogExprEditor ee = new DialogExprEditor(_Draw, cv, _FilterParent, false); try { DialogResult dlgr = ee.ShowDialog(); if (dlgr == DialogResult.OK) dgc.Value = ee.Expression; } finally { ee.Dispose(); } } }