ChildFormDialog-Question/Problem


Author
Message
Thomas Holste
Thomas Holste
StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi Edhy,

thanks for your patience. I've layed this issue aside for a moment as I feel I am too stuck with it and pick it up after a while and start again with another combo.

Best regards

Thomas
Edhy Rijo
E
StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Thomas,

Well this is one of those things where one can easily make a mistake selecting the wrong field or index, but if using Text is working for you and you are able to save/retrieved what you select from the combo, then leave it like that and move on.  Again without a sample project or looking at your project it is very difficult to figure out what else may be going on there.
Good luck!!!

Edhy Rijo

Thomas Holste
Thomas Holste
StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi Edhy,

I set BindingProperty to "selected value" and set the values for topmost-item, but when I choose anything else but the topmost-item, it is not displayed in the entry-part of the Combo.

But as long as my combobox works with the BindingProperty set to Texte I am happy that I got  working solution.

Thanks and best regards

Thomas
Edhy Rijo
E
StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Thomas Holste (7/26/2012)
When I set it to selectedvalue, all records which do not have the field in the customer-record filled, show up with the first value from the lookup-table and not as intended, with an empty entry.

You need to setup the TopMostItem properties of the combo in combination with the "NULL Value Option" setup in the BOM, in the image below I setup the field in the BOM to return 0 when NULL, so using the combobox.TopMostItem I can enter a description <Enter or Select Card Code> and then the value of 0 (zero) so when I get a NULL field it will show my description.  Look it in the help file for better explanation.

http://forum.strataframe.net/Uploads/Images/40c57c65-67c9-4ba9-8631-afe9.png

Edhy Rijo

Thomas Holste
Thomas Holste
StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi Edhy,

is your property-sheet-example from a combobox set to "dropdown-list"? My combobox ist set up as "dropdown".

All my settings look like yours, except for the Bindingproperty. When I set it to selectedvalue, all records which do not have the field in the customer-record filled, show up with the first value from the lookup-table and not as intended, with an empty entry.

Best regards

Thomas
Edhy Rijo
E
StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Well, the BindingProperty for combobox should be set to SelectedValue no text, but if in your case is working is because something else may not be set correctly with the PopulationDataSourceSettings, see sample below:
http://forum.strataframe.net/Uploads/Images/f1ee4303-27e4-4748-b1a2-b5aa.png

Edhy Rijo

Thomas Holste
Thomas Holste
StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi Edhy,

thanks again for your help. The problem was that I had to set tthe BindingFormat-Property to Text. Now everything seems to work.

Best regards

Thomas
Edhy Rijo
E
StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Thomas,

I am glad you are finding your way out Tongue

Now for the combobox list population, it is fairly simply, the key is that the field used in the Value Member should match the one used for binding in your form's BO.  In the sample image below, I have only one field in this table and it happens to be the same used as Display Member, but most of the time it is not.
http://forum.strataframe.net/Uploads/Images/75f1634a-ff01-415d-9e32-163d.png

Also on a side note, in the Business Object Mapper (BOM) make sure you are using setting the "NULL Value Option" to "Return Alternate on Null" for each field ex: Return 0 for Integers and String.Empty or "" for Strings.  I noticed that in some 3rd party controls like DevExpress grids it helps to do this.

Edhy Rijo

Thomas Holste
Thomas Holste
StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi Edhy,

I've traced the problem to a combobox-control. I had not set the population-propertie and after I did that, the error disappeared.

But another problem gas occured. I can now select an item from the dropdown-list but it is not displayed in the entry-part of the combo. When I then try to leacve the field I get the same dbnull-error. I am sure I missed some property-setting but haven't yet found out what.

I set the Binding-Field and business-object and the choose "Business Object" as population type. Afterwards I set up the populationdatasourcesetting by choosing the BO and its fill-method, its field to display and the three values for Display Member Format String ({0}), Dropdown Display Format ({0}) and the value member (Name of the field).

Best regards

Thomas
Edhy Rijo
E
StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Thomas,

I understand your reason and agree with you on that.

Now I will try to help you with the current situation which I believe the problem is the error you are getting when doing the undo.  This could end up being a large thread so if after my response you don't get the issue fixed, it would be easier if you create a quick VB sample using the SF Database with a grid and a childform so I can help you out better.

Based on your explanation, you are passing some parameters to the child form just to see if you are Adding or Editing a record, right?  If so, you don't need to do that, once the BO is translated in the child form you can check the bo.EditingState and that will tell you if you are in Adding/Editing/Idle.

Now I guess you are getting the cast error because there is no record in the BO when you are trying to do the Me.KundenBO1.Undo(MicroFour.StrataFrame.Business.BusinessUndoType.CurrentRowOnly).  Make sure the Me.KundenBO1.Count is > 0

I would assume you have used the ChildFormDialog control before, but let me explain what the BO translation does, it will simply pass the current Parent BO instance into the Child Form, so you will be working basically with the same BO in its current EditingState and when you close the child form, whatever changes you have made to that BO it will be translated back to the parent form BO instance.  Knowing that, it is important to know that you should not move the BO.CurrentRowIndex or Fill the child form BO instance again or you will get all kind of weird errors.

I love the ChildFormDialog functionality and flexibility, so I use it constantly in all my applications with and without ListViews.


Edhy Rijo

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