ATMLCommonLibrary.controls.physical.PhysicalTypeControl.dgErrorLimits_CellContentClick C# (CSharp) Method

dgErrorLimits_CellContentClick() private method

private dgErrorLimits_CellContentClick ( object sender, DataGridViewCellEventArgs e ) : void
sender object
e DataGridViewCellEventArgs
return void
        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);
                }
            }
        }