private void buttonEditErrorType_ButtonClick(object sender, ButtonPressedEventArgs e) { ds_error.errorRow errorRow = (ds_error.errorRow) this.bsError.DataSource; if (e.Button.Index == 0) { errorRow.SetiderrortypeNull(); errorRow.Seterrortype_nameNull(); } else { ErrorTypeForm errorTypeForm = new ErrorTypeForm(); if (errorTypeForm.ShowDialog() != DialogResult.OK) { return; } DataRow dataRow = AtGrid.getDataRow((Control)errorTypeForm.gridControlErrorType); if (dataRow == null) { return; } errorRow["iderrortype"] = dataRow["iderrortype"]; errorRow["errortype_name"] = dataRow["name"]; } this.buttonEditErrorType.Text = errorRow["errortype_name"].ToString(); }
private void ButtonEditErrorType_ButtonClick(object sender, ButtonPressedEventArgs e) { DataRow dataRow1 = AtGrid.getDataRow((Control)this.gridControlError); if (dataRow1 == null) { return; } this.ButtonEditErrorType.BeginUpdate(); try { if (e.Button.Index == 0) { dataRow1["iderrortype"] = (object)DBNull.Value; dataRow1["errortype_name"] = (object)DBNull.Value; } else { ErrorTypeForm errorTypeForm = new ErrorTypeForm(); if (errorTypeForm.ShowDialog() != DialogResult.OK) { return; } DataRow dataRow2 = AtGrid.getDataRow((Control)errorTypeForm.gridControlErrorType); if (dataRow2 == null) { return; } dataRow1["iderrortype"] = dataRow2["iderrortype"]; dataRow1["errortype_name"] = dataRow2["name"]; } } finally { this.ButtonEditErrorType.EndUpdate(); } }