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) { int cr = dgFilters.CurrentRowIndex; if (cr < 0) { // No rows yet; create one string[] rowValues = new string[3]; rowValues[0] = null; rowValues[1] = null; rowValues[2] = null; _DataTable.Rows.Add(rowValues); cr = 0; } DataGridCell dgc = dgFilters.CurrentCell; int cc = dgc.ColumnNumber; DataRow dr = _DataTable.Rows[cr]; string cv = dr[cc] as string; if (cc == 1) { // This is the FilterOperator DialogFilterOperator fo = new DialogFilterOperator(cv); DialogResult dlgr = fo.ShowDialog(); if (dlgr == DialogResult.OK) { dr[1] = fo.Operator; } } else { DialogExprEditor ee = new DialogExprEditor(_Draw, cv, _FilterParent, false); DialogResult dlgr = ee.ShowDialog(); if (dlgr == DialogResult.OK) { dr[cc] = ee.Expression; } } }
private void bValueExpr_Click(object sender, System.EventArgs e) { int cr = dgFilters.CurrentRow.Index; //if (cr < 0) //{ // No rows yet; create one // string[] rowValues = new string[3]; // rowValues[0] = null; // rowValues[1] = null; // rowValues[2] = null; // _DataTable.Rows.Add(rowValues); // cr = 0; //} 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); DialogResult dlgr = fo.ShowDialog(); if (dlgr == DialogResult.OK) { dgc.Value = fo.Operator; } } else { DialogExprEditor ee = new DialogExprEditor(_Draw, cv, _FilterParent, false); DialogResult dlgr = ee.ShowDialog(); if (dlgr == DialogResult.OK) { dgc.Value = ee.Expression; } } }
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) { int cr = dgFilters.CurrentRow.Index; //if (cr < 0) //{ // No rows yet; create one // string[] rowValues = new string[3]; // rowValues[0] = null; // rowValues[1] = null; // rowValues[2] = null; // _DataTable.Rows.Add(rowValues); // cr = 0; //} 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); DialogResult dlgr = fo.ShowDialog(); if (dlgr == DialogResult.OK) dgc.Value = fo.Operator; } else { DialogExprEditor ee = new DialogExprEditor(_Draw, cv, _FilterParent, false); DialogResult dlgr = ee.ShowDialog(); if (dlgr == DialogResult.OK) dgc.Value = ee.Expression; } }
private void bValueExpr_Click(object sender, System.EventArgs e) { int cr = dgFilters.CurrentRowIndex; if (cr < 0) { // No rows yet; create one string[] rowValues = new string[3]; rowValues[0] = null; rowValues[1] = null; rowValues[2] = null; _DataTable.Rows.Add(rowValues); cr = 0; } DataGridCell dgc = dgFilters.CurrentCell; int cc = dgc.ColumnNumber; DataRow dr = _DataTable.Rows[cr]; string cv = dr[cc] as string; if (cc == 1) { // This is the FilterOperator DialogFilterOperator fo = new DialogFilterOperator(cv); DialogResult dlgr = fo.ShowDialog(); if (dlgr == DialogResult.OK) dr[1] = fo.Operator; } else { DialogExprEditor ee = new DialogExprEditor(_Draw, cv, _FilterParent, false); DialogResult dlgr = ee.ShowDialog(); if (dlgr == DialogResult.OK) dr[cc] = ee.Expression; } }