private void btnLimit_Click(object sender, EventArgs e) { PhysicalTypeErrorLimitForm form = new PhysicalTypeErrorLimitForm(); if (_rangingInformation != null) { form.ErrorLimit = _rangingInformation.ErrorLimit; } if (DialogResult.OK == form.ShowDialog()) { ErrorLimit limit = form.ErrorLimit; edtErrorLimit.Text = limit.ToString(); edtErrorLimit.Tag = limit; } }
private void dgErrorLimits_CellContentClick(object sender, DataGridViewCellEventArgs e) { var senderGrid = (DataGridView)sender; if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0 && e.ColumnIndex == 0) { PhysicalTypeErrorLimitForm form = new PhysicalTypeErrorLimitForm(); DataGridViewRow row = dgErrorLimits.Rows[e.RowIndex]; form.ErrorLimit = row.Tag as ErrorLimit; if (DialogResult.OK == form.ShowDialog()) { SetRowData(row, form.ErrorLimit); } } }
private void dgRanges_CellContentClick(object sender, DataGridViewCellEventArgs e) { var senderGrid = (DataGridView)sender; if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0 && e.RowIndex != dgRanges.NewRowIndex && e.ColumnIndex == dgRangesULErrlmtColumn.Index) { PhysicalTypeErrorLimitForm form = new PhysicalTypeErrorLimitForm(); DataGridViewRow row = dgRanges.Rows[e.RowIndex]; RangingInformation range = row.Tag as RangingInformation; if (range != null) { form.ErrorLimit = range.ErrorLimit; if (DialogResult.OK == form.ShowDialog()) { range.ErrorLimit = form.ErrorLimit; row.Tag = range; senderGrid.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = range.ErrorLimit == null ? "[Press to Add/Edit the Error Limit]" : range.ErrorLimit.ToString(); } } } }
private void btnLimit_Click(object sender, EventArgs e) { PhysicalTypeErrorLimitForm form = new PhysicalTypeErrorLimitForm(); if( _rangingInformation != null ) form.ErrorLimit = _rangingInformation.ErrorLimit; if (DialogResult.OK == form.ShowDialog()) { ErrorLimit limit = form.ErrorLimit; edtErrorLimit.Text = limit.ToString(); edtErrorLimit.Tag = limit; } }