StarkMike
|
|
Group: Forum Members
Posts: 436,
Visits: 944
|
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?
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
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.
|
|
|
StarkMike
|
|
Group: Forum Members
Posts: 436,
Visits: 944
|
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?
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
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.
|
|
|
StarkMike
|
|
Group: Forum Members
Posts: 436,
Visits: 944
|
What do you mean about BusinessBindingSource?
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
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.
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
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.
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
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
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
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 ...
|
|
|
StarkMike
|
|
Group: Forum Members
Posts: 436,
Visits: 944
|
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?
|
|
|