By StarkMike - 9/22/2006
I noticed some strange behavior on a form that I had already created that WAS working fine and then when I went to run it yesterday its not working properly. The one thing I noticed was that the Business objects that I had created on this form (or any form after i had done a little investigation) weren't showing up in the datasources property anymore. The screen shot below will illustrate that.
Any ideas why this is happening?
|
By StrataFrame Team - 9/22/2006
Well, you have to use a BusinessBindingSource to bind a business object as a data source (if you have v 1.4.1 or newer I believe). Also, the business objects almost always show up under the "Other Data Sources" option in the tree view, so you probably just need to expand that node and they'll be there.
|
By StarkMike - 9/22/2006
Ok i've tried a couple things (one of them being repair Visual Studio) and nothings working. Now I dont have anything in the data sources drop down.
And when I try to add data sources through the Data Source Configuration Wizard and I choose object and then click Next I get this error (also attached).
Error Message: object reference not set to an instance of an object
I have attached a screenshot of my current problem.
Any ideas?
|
By StrataFrame Team - 9/22/2006
It might be something to do with that project... before you start taking your solution apart, try creating a sample project and see if it works in there.
|
By StarkMike - 9/22/2006
What do you mean about BusinessBindingSource?
|
By Trent L. Taylor - 9/23/2006
A BusinessBindingSOurce is a StrataFrame control that allows 3rd party controls, such as grids and reports, talk to a business object as though each row is a new business object. Without this, some grids will not work properly because when they reference the strong-typed property, it will always return the same row. Going throug the BusinessBindingSource resolves this issue.
|
By Ivan George Borges - 9/23/2006
Hi Trent.As you are in the subject, I tried this with xtraReports so to be able to drop a BO in it. I almost made it work. I managed to make the report field pick list be populated with the BO, got happy with this. But then, I get: The object that the business object has been dropped on must implement MicroFour.StrataFrame.UI.Windows.Forms.IContainerControl.
I searched here in the forum and saw some talk about this, but at this level it was beyond my knowledge.
|
By Trent L. Taylor - 9/23/2006
Ivan,The reason you got this message is because the form you dropped the business object on is not inherited from MicroFour.StrataFrame.UI.Windows.BaseForm or MicroFour.StrataFrame.UI.Windows.UserControl. The BaseForm is the root of all StrataFrame forms. Both the BaseForm and UserControl have an interface called IContainerControl that has methods and properties that allow a parent container control, such as a form or user control, to have business objects dropped on them and then to know exactly how to manage those instances (Form Saves, Undos, etc.). Bottom line, to resolve your error, just base your form off of something like: MicroFour.StrataFrame.UI.Windows.Forms.StandardForm Hope this makes sense 
|
By Ivan George Borges - 9/25/2006
I dropped it in an xtraReports layout, in the report designer.It was only a test, anyway. I don't think this is going to be the best practice to build reports. I have a feeling that the temp BO I heard from you in another thread will do it better. I'm now wondering where I will put the code to populate this "cursor", and them, how to bind these fields into xtraReports controls. Fun, fun, fun ...
|
By StarkMike - 9/25/2006
Well, you have to use a BusinessBindingSource to bind a business object as a data source (if you have v 1.4.1 or newer I believe). This is what Ben said and it confused me because I dont remeber having to do that before. Is that something that changed in 1.4?
|
By StarkMike - 9/26/2006
Hey Guys, Disregard my last post.... I re-read Trent's last post to me and I double checked and the form I dropped the BO's onto is a StrataFrame form and I'm still not seeing the BOs.
What next?
|
By Trent L. Taylor - 9/26/2006
It sounds like you have errors in your form, which can cause this problem. If you bring up the error window, what are the errors in your application? Secondaly, if you open the Form.Designer.vb file, do you see the BO declarations in this file?
|
By StarkMike - 9/26/2006
There are no outstanding errors or warnings in the error list for that form and here is what I found in the Designer file:Me.DivisionsBO1 = New STI.DivisionsBO(Me.components) ' 'DivisionsBO1 ' Me.DivisionsBO1.ParentContainer = Me Me.DivisionsBO1.SynchronizingObject = Me Friend WithEvents DivisionsBO1 As STI.DivisionsBO P.S. I'm not getting email alerts when you respond to my posts. In the Topic Subscription Notification Type I'm still choosing Immediate Notification of New Posts by Email.
|
By StrataFrame Team - 9/26/2006
It might be a problem in either the BusinessBindingSource, or within the type editor for the DataSource property. One way to tell whether the type editor is having issues is to add a DataSet to the form and see if the grid can see the DataSet as a selectable component within list of available data sources.
|
By StarkMike - 9/26/2006
Ok I'll try that.
However, is the BusinessBindingSource something you guys use internally in your framework? I know it is a native .NET control or component. You keep mentioning it and in the time that I have been using StrataFrame I've never used one. Is that something you changed in 1.4?
|
By StarkMike - 9/27/2006
I added an untyped data set to a StrataFrame form and here is the data sources window.
|
By StrataFrame Team - 9/27/2006
OK, so the type editor is working. If you are using 1.4.1 or 1.5, the business objects no longer act as "data sources" for grid data binding. There is a new component that you need to use called the BusinessBindingSource. If you don't have the BusinessBindingSource in your toolbox, you will need to recreate your toolbox tab. Once you drop a BusinessBindingSource on the form, you can set the BusinessObject property on the BusinessBindingSource and the BBS will show up in the DataSources tree in the same place as your untyped DataSet.We removed the IBindingListView interface from the business objects (the interface that makes them show up in that DataSources list) because there were some issues with implementing it on the business objects directly. So, we implemented the interface on a separate component and you use that separate component as a "wrapper" on the business object to allow the business object to be accessed like a data source.
|