#region Internal Row Procedures
internal static void RowCancel(DataView TargetDataView,ClientMessage Message) { Message.MainForm.BindingContext[TargetDataView].CancelCurrentEdit(); }
internal static void RowDelete(DataView TargetDataView,ClientMessage Message) { if(Message.MainForm.BindingContext[TargetDataView].Count > 0) { try { Message.MainForm.BindingContext[TargetDataView].RemoveAt( Message.MainForm.BindingContext[TargetDataView].Position); Message.ReadyToEdit(); Message.MainStatusPanel.Text = "Record deleted."; } catch(Exception Ex) { Message.ClientErr(); Message.MainStatusPanel.Text = Ex.Message; MessageBox.Show(Ex.Message); } } }
internal static void RowEndEdit(DataView TargetDataView,ClientMessage Message) { Message.MainForm.BindingContext[TargetDataView].EndCurrentEdit(); }
internal static void RowNew(DataView TargetDataView,ClientMessage Message) { try { Message.MainForm.BindingContext[TargetDataView].EndCurrentEdit(); Message.MainForm.BindingContext[TargetDataView].AddNew(); Message.ReadyToEdit(); Message.MainStatusPanel.Text = "New record added."; } catch(NoNullAllowedException Ex) { /* Ignore this exception. It will thrown again when the Position property is changed. */ Ex.GetType(); } catch(Exception Ex) { Message.ClientErr(); Message.MainStatusPanel.Text = Ex.Message; MessageBox.Show(Ex.Message); } }
#endregion