I am pretty new to MM, but my colleague and I recently discovered an annoying bug in the VS.NET parser. We are both running MS VS.NET 2003.
What we found was, that if we were registering a business object on a winform derived directly from OakLeaf.MM.Main.Windows.Forms.mmMaintenanceForm, if we registered the object with the form in the form's constructor using,
this.testBizObj = (aBizObj)this.RegisterPrimaryBizObj(new aBizObj());
We could bind a DataGrid control by clicking on the "…" button in the DataGrid's Binding Source property and selecting
aBizObj
.
If a blank was inserted before the
new
, however, so that the code looked like,
this.testBizObj = (aBizObj)this.RegisterPrimaryBizObj( new aBizObj());
then
aBizObj
no longer appeared in the Binding Source Selection dialog. Further, manually typing
aBizObj
's classname into BindingSource and
aBizObj.TableName
into the BindingSourceMember property didn't bind the DataTable in
aBizObj
to the DataGrid.
Removing the superfluous blank fixed the problem. It seems to be a parsing bug in VS.NET 2003. I wanted to post it in this forum in case anyone else came across it, since we spent a while scrutinizing the constructor for aBizObj and wondering where we went wrong.
My colleague likes the open, airy style of,
this.testBizObj = ( aBizObj ) this.RegisterPrimaryBizObj ( new aBizObj() );
while I am more compact. For other claustrophobic coders, be warned.
David S. Alexander
Kettley Publishing
20271 SW Birch Street, 2nd Floor
Newport Beach, CA 92660-1752