Has anyone had experience with binding a DataGridView to Strataframe Business Objects ?
I have attempted to but it seems the Strataframe binding source component does not implement the same interfaces as required by the DataGridView.
SF BusinessBindingSource: – Implements: IBindingListView, ITypedList, ICancelAddNew, ICurrencyManagerProvider (IBindingListView, Implements: ICollection IEnumerable IList IBindingList)
Wisej BindingSource.DataSource – Implements: IBindingList In addition, DataSource can be set to other list types such as IListSource and ITypedList.
Hi Kingsley.
Yep, I hit the same limitations as you did. So far, I haven’t used the BindingSource for the grids and I usually get the row PK and fill another BO instance with the grid current row, and from then on I do whatever has to be done.
And you are right, we can take advantage of all the other business layer features. In my case I am doing a migration to the web and I have loads of BOs and their rules, etc., which are ready to go. I also use the Security feature completely, will also create the UI for it later. Not to mention the BOM and DDT.
On maintenance forms, I have migrated the SF MaintenanceToolStrip and am able to take advantage of all BO events and methods.
So far its been saving a lot of time for the whole process.
Cheers.
Ivan
Hi Ivan
Thanks for the response.
I had got as far as using myBO.CurrentView with WiseJ BindingSource for a DataGridView and BindingNavigator
Me.BindingSource1.DataSource() = myBO.CurrentView
DataGridView1.DataSource = BindingSource1
bnav1.BindingSource = BindingSource1
Trouble is (as expected) I cannot bind to custom fields defined in the business object when we use CurrentView or CurrentDataTable. Also the BO.Move/Navigate methods don’t affect the grid current row. But you can handle BO nav events to do this.
And it looks like I’ll need to wire-up CRUD operations from the grid to the BO
So I guess it half works. We can still use the data access part of the SF BusinessLayer, BO.Fills etc (which saves a lot of ADO.NET data access plumbing) and code that was working with BOs, but binding to controls looks like it has limitations. Still looks like its worth migrating SF BOs to WiseJ web app though.
Kingsley
By the way, as for a Wisej DataGridView I have done it just setting the CurrentView to it.
this.myDGV.DataSource = this.myBO.CurrentView;
Hi Kingsley.
I have been binding SF Business Objects to Wisej DevExpress DataGrids Extensions using the AsEnumerable from DataTable.
It looks like this:
this.myDataGridView.Options.dataSource = this.myBO.CurrentDataTable.AsEnumerable();
Hope it helps.
Ivan
Please login first to submit.