DevExpress Grid and SF


Author
Message
Terry Bottorff
Terry Bottorff
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 448, Visits: 12K
I am using the latest version of DevExpress and SF in VS 2008. I created a BO and just by using a break point I found that it does have data in it. I also created a Custom Business Binding Source and put in the code so it does appear on my toolBox. I dropped the BO and the BBS on my form. I also have placed a DevExpress Grid on my form.

Using the little black arrow on the top right of the grid(forgot what it is called) I did the following steps:

1. Choose Data Source.

2. Add Project Data Source.

3. Choose Object as data type.

4. Found my BOLib, found my BBS and selected it.

5. It immediately created the databindingsource and put the columns that I want in the grid.

6. I looked at the columns and they have the correct field names in them.

7. Because of #5 and #6 I think the grid is set up correctly?????

8. Run project and the grid shows with the column titles but no data.



What am I missing? TIA.

Replies
Peter Jones
Peter Jones
Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 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 (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
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
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 448, Visits: 12K
Thank you so much.
Terry Bottorff
Terry Bottorff
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K 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 (154 views, 8.00 KB)
Terry Bottorff
Terry Bottorff
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K 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
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Terry Bottorff - 16 Years Ago
Trent L. Taylor - 16 Years Ago
Terry Bottorff - 16 Years Ago
Terry Bottorff - 16 Years Ago
Terry Bottorff - 16 Years Ago
Peter Jones - 16 Years Ago
Terry Bottorff - 16 Years Ago
Peter Jones - 16 Years Ago
Terry Bottorff - 16 Years Ago
Peter Jones - 16 Years Ago
Trent L. Taylor - 16 Years Ago
Terry Bottorff - 16 Years Ago
                     No problem, just wanted to make sure that it worked. Thanks. :)
Trent L. Taylor - 16 Years Ago
                     I replaced all the references from 8.2 to 9.1 and rebuilt the...
Terry Bottorff - 16 Years Ago
                         Well, you still have 8.2 references in either the designer file or the...
Trent L. Taylor - 16 Years Ago
                             OK thanks.........
Terry Bottorff - 16 Years Ago
Terry Bottorff - 16 Years Ago
Trent L. Taylor - 16 Years Ago
Peter Jones - 16 Years Ago
Terry Bottorff - 16 Years Ago
Peter Jones - 16 Years Ago
Terry Bottorff - 16 Years Ago
Peter Jones - 16 Years Ago
Trent L. Taylor - 16 Years Ago
                 Thank you so much.
Terry Bottorff - 16 Years Ago
Terry Bottorff - 16 Years Ago
Terry Bottorff - 16 Years Ago
Peter Jones - 16 Years Ago
Peter Jones - 16 Years Ago
Terry Bottorff - 16 Years Ago
Trent L. Taylor - 16 Years Ago
                     I'll try it and let you know. Thank you very much.
Terry Bottorff - 16 Years Ago
                         No problem. :)
Trent L. Taylor - 16 Years Ago
Terry Bottorff - 16 Years Ago
Trent L. Taylor - 16 Years Ago
Terry Bottorff - 16 Years Ago
                     When I started playing with the DevExpress Grid I put in the...
Terry Bottorff - 16 Years Ago
                         Terry,

This post confuses me as the sample I posted SHOWs...
Trent L. Taylor - 16 Years Ago
Terry Bottorff - 16 Years Ago
Terry Bottorff - 16 Years Ago
Trent L. Taylor - 16 Years Ago
                 Yes I did get it. Thanks.
Terry Bottorff - 16 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search