Cannot see Events


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I've created a Businessobject. I've created a form and added a few controls, textbox, TabPage and Labels, and set up the bindings to the business object...all seems to be working fine.

I now want to insert some code into the ParentFormLoading but cannot see any of the events.I've right clicked on the Form to view Code but on the dropdown menu at the top of the code file, in the left menu, all I can see is one option, which is the Form. All the objects come up ok on the right hand side for the form.

Am using Ver 1.6.7 (all SF controls say ver 1.6.6.9) and C#

Attachments
Screen.jpg (124 views, 172.00 KB)
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Gerard,



You are looking in the wrong file "Form1.Designer.cs", put your code in the "Form1.cs" file.

Edhy Rijo

Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Edhy

I changed to the Form1.cs but it does not seem to make any difference

I have highlighted Form1.cs in solution explorer, Right Clicked, View Code, and this gives two drop downs on top of the code. On the LHS I have only one option(StrataframeWindowsApplication.Form1) which I select , and on the RHS Form1(). which if I select, it shows me all the controls

From looking at the tutorial, I was expecting to see, on the left hand side, a drop down whcih shows all the events, and if I select one, it creates the empty block of code, into which I insert my code.

Am I on the right track ?

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
Your approach will not work in C#.  In VB you can drop down the and select the object from the list on the left.  You cannot do this in C#.  So you can do this one of two ways. 

UI Approach
Open the designer and select the business object.  Then go to the property sheet and select the event display:

This will present all of the events for that object.  At this point, double-click the ParentFormLoading event and it will automatically add the handler and take you to the method definition that gets generated.  Just FYI, the default event for a BO is the ParentFormLoading event, so if you were to just double-click the BO from the form designer it would create this event for you as well.

Code Approach
This is a bit more technical, but in short you would do the same thing that the automated process does for you by creating a handler.  C# is nice in this area in code because when you go to handle an event you can tab and it will create the placeholder methods for you.  But it would look like this:

this.Customers.ParentFormLoading += new MicroFour.StrataFrame.UI.IInitOnFormLoad.ParentFormLoadingEventHandler(Customers_ParentFormLoading);

Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)Advanced StrataFrame User (646 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Trent.

Thanks for that. When I go into the PEMs and select it from there, it works fine now.

I now have a problem when trying to save. It says I cannot insert /update because the BO does not contain any PrimaryKeyFields. The BO is based on a Table with an Identity so I dont know why this is happening. I then over-rode the Primary Key of the BO with the Identity field, but still get the same error.

Is there sometning else I need to do to tell SF the field that is the primary key ?

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
You must have a primary key assigned to the table.  If you do, then when you map the BO through the BO Mapper it will see the primary key and it will be assigned to the mapping.
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