protected OakLeaf.MM.Main.Windows.Forms.mmButtonDelete btnDelete; protected OakLeaf.MM.Main.Windows.Forms.mmButtonNew btnNew; protected OakLeaf.MM.Main.Windows.Forms.mmButtonSave btnSave; protected OakLeaf.MM.Main.Windows.Forms.mmButtonCancel btnCancel;My question is: Given that there will only be one business object on most of the forms I will subclass from bxCardForm, is there any point in setting the BindingSource property of these four buttons on the table-specific forms?
protected virtual void btnNew_Click(object sender, System.EventArgs e) { // Only navigate if the navigation controls' business object // is the same as the object we're adding a DataRow to if (this.NavControl != null && (this.GetBizObj(this.NavControl.BindingSource) == this.btnNew.GetBizObj())) { if (btnNew.GetBizObj(this) == this.GetBizObj(this.NavControl.BindingSource)) { // Determine if bound to a DataTable or DataView string TableName, ViewName; mmBindingStrategyBase.GetBindingSource(this.btnNew.BindingSourceMember, out TableName, out ViewName); if (mmString.Empty(ViewName)) // Bound to a DataTable...Navigate to the last record this.NavigateData(mmNavigate.Last, false); else // Bound to a DataView...Navigate to the first record this.NavigateData(mmNavigate.First, false); } } }(I removed the call to this.SelectEditPage(), which is not relevant since I don't have "list" and "properies" tabs on my form.)
mmBindingStrategyBase.GetBindingSource(this.btnNew.BindingSourceMember,
out TableName, out ViewName);
...the strings TableName and ViewName are both empty. So, I figured setting BindingSource might be required. (But setting it to the table of the primary business object didn't do anything: TableName and ViewName both still come out empty.)