DevExpress Grid and SF


Author
Message
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
Terry,



You are correct in that it should not be this difficult, so most likely, I have learned from experience, there is probably something simple not being done. I have attached a C# simple sample using a BO, BBS, and a DevEx grid (v8.2, you may need to update your references to make this sample work).
Attachments
DevExGrid.zip (128 views, 87.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
Peter first I want to thank you for the help you are offering.

I put Me.MyBBS.BusinessObject.CurrentView in the watch Window and used the visualizer.....NO DATA?????? So obviously no data in the grid....?

This the my code for the form. I tried loading the data in the load and the new.

me.customers1.currentview Shows all the records in the sample customers database since all I did was a "Select * from customers".





Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Me.Customers1.fillalldata()

End Sub

Public Sub New()

' This call is required by the Windows Form Designer.

InitializeComponent()

' Add any initialization after the InitializeComponent() call.

'Me.Customers1.fillalldata()

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

' Break Point

End Sub

End Class





Scanning under my BBS I did run into this info which does not seem correct to me but I don't know how to fix it or if it is even wrong?????



CurrentRow{"The CurrentRow for table '[dbo].[Customers]' could not be evaluated because the CurrentRowIndex is out of range. Business object record count: 0. CurrentRowIndex: -1."}System.Data.DataRow



TIA.
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
Terry, did you download my sample and see if it worked in your development environment?
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
Op's Trent I missed your reply this morning. I will look at the sample. Thank you so very much........ I will get back to you.
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
No problem, just wanted to make sure that it worked. Thanks. Smile
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 replaced all the references from 8.2 to 9.1 and rebuilt the solution. I run and I get this error? I also replaced the grid with the new 9.1 grid.

Remember I am not very good at this yet.....









ApplicationException

An error occurred while creating the main form

TargetInvocationException

Exception has been thrown by the target of an invocation.

FileNotFoundException

Could not load file or assembly 'DevExpress.XtraGrid.v8.2, Version=8.2.8.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1' or one of its dependencies. The system cannot find the file specified.



Source : MicroFour StrataFrame UI



Stack Trace:

at DevExGrid.Form1.InitializeComponent()

at DevExGrid.Form1..ctor() in c:\Temp\DevExGrid\DevExGrid\Form1.cs:line 21

at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)

at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)

at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)

at System.Activator.CreateInstance(Type type, Boolean nonPublic)

at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)

at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)

at MicroFour.StrataFrame.Application.StrataFrameApplication.RunApplication()

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
Well, you still have 8.2 references in either the designer file or the licenses.lic file (or both) which is producing this error. I have sent an email to DevExpress about giving us another license to work with so that I can get on 9.1. We have been seeing a lot more errors since some of our users have moved over to 9.1, so if I get the newer license, then I will recompile the sample and re-post it.
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 thanks.........
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,



The call Me.Customers1.fillalldata() should be in the ParentFromLoading event of your BO. This way, whenever you drop the BO onto a form, it will just 'fill'. The way you have it at the moment you will need to execute Me.Customers1.fillalldata() in every form that is using the BO. So, why don't you make that change anyway but I don't know that it will help your problem much.



I would then put a breakpoint on the line and see what the status is after fillalldata runs. On the question of fillalldata this is obviously custom code - are you sure it works?



Why don't you try the basic SF method of: Me.Customers1.FillDataTable("put your Select * code in here") to see what happens.





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
Alright here is what my ParentFormLoading looks like:



Private Sub Customers_ParentFormLoading() Handles Me.ParentFormLoading

Me.FillDataTable("select cust_lastname,cust_firstname from customers order by cust_lastname")

End Sub



I put a break point on the "me" statement and after I continued one line in the watch window I put:

me.currentview and looked at the visualizer and it had the data. I could not find out how to look at the BBS data there. Is there a way? Then I continued back to the form and the gird had No Data..... I still had a break point on the click of a button and I looked at these:

me.customers1.currentview and it had data.

me.customersBBS!.BusinessObject.Currentview and it had NO DATA.

Again thank you for all the help and time.





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