DevExpress Grid and SF


Author
Message
Peter Jones
Peter Jones
Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Terry,



In the properties of your BBS "BusinessObject" needs to point to the BO that contains the data - does it?



Also in the line "me.customersBBS!.BusinessObject.Currentview and it had NO DATA" I see that there is an explanation point after BBS - is this just a typo in your post or something more meaningful?



Cheers, Peter
Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
I could not find any properties in the actual BBS that pointed at the BO.

The properties of the BBS instance on the form shows all of the columns of the BO But I don't see that it points directly at the BO with it's name in some property. Also, the ! was a keyboard mistake or a frustration mistake. Sorry about that.

Since I put the BBS on my toolbox and drug it to the form I don't need a statement like this do I? But if I do where would it be put?



Dim myBBS as customersBBS



Peter Jones
Peter Jones
Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Terry,



"I could not find any properties in the actual BBS that pointed at the BO."



That's interesting because to associate a BBS to a BO you do need to know this (well, the way we do it we do). The process we use which I believe is normal is:



1) Create your BO's which are normally associated with single table and can contain custom columns.



2) Use the BO's by dropping them on forms as needed.



3) Then, for each BO that you want to use in DX grid drop a SF BBS onto the form.



4) When the BBS lands on the form this automatically opens the BBS' property sheet in Solutions Explorer.



5) In the property sheet there is a property called BusinessObject.



6) Open the combo box in BusinessObjects and you are given the the list of BO's on the form. Simply choose one and that's it.



7) Now make the BBS the data source for your grid.



Note: if you delete your BBS for some reason and recreate it it will no nolonger be the data source for your grid. It gets removed when the BBS is deleted.



Cheers, Peter



Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Just FYI, I have download the 9.2 build of DevExpress and I will re-compile the sample and re-post it this evening.  I am out of the office today, but I will get this posted with the new DevExpress version so that you don't have to worry with references.
Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
Thank you so much.
Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
Peter: I followed your step by step outline. I created a new project and I added a maintenance form just so I could check the BO Data. I did not know you could drag a drop a BBS to your form so I did learn something there ( always just added a new item to the project and then put it on the toolbox and drug it to the form). I did get the property BusinessObject and set it like you said in #5. I set the data source in the devgrid to my BBS. Ran the program and now on every field I get the following error on the Public Property [each field] as ..... :



Get

return ctype(me.currentRow.Item("cust_Prefix"),system.string) =error received=>Column 'cust_prefix does not belong to table Customer.

end get



I know it is every field because I went into the devgrid and deleted the first field and then the error on that field went away. Then I deleted the next column and then the error went away.... and so forth?



If I run the project without the devgrid it runs even with the BBS on the form but just not attached to anything?

I have just about had it. I think I will uninstall SF and reinstall and see what happens. It is almost like I have a corrupted ????? somewhere and the BO and BBS are not talking or something.....?



Attachments
ErroronFields.png (117 views, 8.00 KB)
Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
OK I now have uninstalled and reinstalled SF to the latest version. Now I create a simple maintenance form, connect to customers with a BO. Put two text boxes and BO on form with binding source to the cust_lastname and cust_firstname.

Run the project and it all loads and the navigation buttons work. Try to Edit and I now get this error?????



BusinessLayerException

An error occurred while saving an the data to the server.

DataLayerSavingException

Cannot create UPDATE command because the updating DataTable does not contain columns for all PrimaryKeyFields.

DataLayerException

Cannot create UPDATE command because the updating DataTable does not contain columns for all PrimaryKeyFields.



Source : MicroFour StrataFrame Business



Stack Trace:

at MicroFour.StrataFrame.Data.DataLayer.BuildUpdateInfo(DataTable UpdatingTable, Boolean Transactional, String TransactionKey)

at MicroFour.StrataFrame.Data.DataLayer.UpdateDataTableThread(Object ThreadParams)

at MicroFour.StrataFrame.Data.DataLayer.UpdateDataTable(DataTable TableToUpdate, Boolean Transactional, String TransactionKey)

at MicroFour.StrataFrame.Data.DataLayer.SaveByForm(DataTable TableToSave, Boolean Transactional, String TransactionKey)

at MicroFour.StrataFrame.Business.BusinessLayer.SaveByForm(Boolean Transactional, String TransactionKey)

at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save(Boolean Transactional, String TransactionKey)

at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save()

at MicroFour.StrataFrame.UI.Windows.Forms.MaintenanceFormToolStrip.cmdSave_Click(Object sender, EventArgs e)

at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)

at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)

at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)

at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)

at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)

at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)

at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)

at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

at System.Windows.Forms.ToolStrip.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)

at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)





I ignored this error by not editing anything and I put the DevExpress Grid on. I put a BBS on and connected it to my BO in the properties. Set the datasource of the grid to my BBS. Run the form and I still get NO DATA in the Grid. So now I have at least 2 problems. Why do I get the above error and still no data in grid????



Crazy
Peter Jones
Peter Jones
Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Terry,



I wonder if there is something pretty basic here. Follow these steps to create a BO and get it into form:





Open your project



Right click on your Project Name



Select Add > New Item



Click SF Business Object



Click StrataFrame in the VS Menu Bar



Click Business Object Mapper



Go to your Project Name and expand



Select your new BO



In right hand panel click Configure Business Object



Select a source etc



When done right click on the BO in left panel and select Build Partial



Close the BO mapper



OPen the new BO



Create the ParentFormLoading event handler



Add some code to fill the BO



Close the BO



Build your project



Open your form



Drop the BO on the form



Drop a BBS on the form and follow the previous instructions





When done this way does it work?



Cheers, Peter
Peter Jones
Peter Jones
Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Terry,





BTW - sorry for the delay in responding - we are obviously in very different time zones.



Cheers, Peter
Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
I realized the time difference but I appreciate ALL the help. I am not under the gun so that is not a problem but it is just so frustrating when it should just WORK. I'll try your steps tomorrow and let you know the outcome. TIA.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search