/// <summary> /// By default a BindingNavigator action buttons perform actions for us, /// in this case Item under BindingNavigator properties, DeleteIem is set /// to none. This way we can prompt for removal rather than doing the actual delete /// where it may had been unintended. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e) { if (Question("Remove current member")) { _bindingSource.DataRow().Delete(); } }
/// <summary> /// Get current record primary key /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void currentPrimaryKeyButton_Click(object sender, EventArgs e) { MessageBox.Show($"Current key: {_bindingSource.DataRow().Field<int>("CustomerIdentifier")}"); }