StrataFrame Forum

How do I handle a combobox and items not in the list?

http://forum.strataframe.net/Topic6173.aspx

By Greg McGuffey - 1/24/2007

How do I handle allowing the user to just add an item to a combo, then adding it to the list/saving it using a BO, and updating the list so the new items is included?


By StrataFrame Team - 1/25/2007

You can allow the combo box to be a DropDown rather than a DropDownList.  When the user saves the current record, also create a new lookup table entry for the value they entered in the combo and save it to the database.  The next time you populate the combo, the new record will be included (because it's in the database).
By Greg McGuffey - 1/25/2007

Hmmm...I notice that I can't make a SF combobox a DropDown style one. Well, more accurately, I can set the property in the designer, but at runtime it always is a DropDownList style. Is this correct? If so, is there a relatively simple way to load a normal .net combo form a BO?



Thanks!
By Greg McGuffey - 1/25/2007

Oh, when using this, do I bind the Text property instead of the SelectedValue property?
By Trent L. Taylor - 1/25/2007

We do this all of the time so there is something else going on in your form.  The only thing we do (to make a disabled drop down list and drop down combo) to make the disabled states look the same is change this when the controls UI state is automatically managed.  This is due to the fact that the standard .NET controls render differently when disabled if a combo is a drop down or drop down list.

To prove that this is not the problem set the IgnoreUIReadonlyState on teh combos to True and see if it works.  The only reason this would not get set back properly is if some event is being managed and changing what the control is expecting when the state is managed.

By Greg McGuffey - 1/25/2007

To prove that this is not the problem set the IgnoreUIReadonlyState on teh combos to True and see if it works.




Yep. This enables editing of the text in the combo.



I have a MaintenanceToolstrip and my BO on the form. I have four procedures in the entire form:





Form load - loads a treeview and fills the BO (BO set to manual filling)



BO AfterSave - reloads the tree, requeries two combos (the ones in question)



Treeview AfterSelect - navigates the BO and show appropriate panel (in a PanelManager)



button Click - closes the form





The tree view has items from the BO in a hierarchy. If a node representing a BO record is clicked, an editor panel is shown and the BO navigates to that panel.



The MaintenanceToolstrip is not showing navigation buttons.



Where do I start looking?
By Trent L. Taylor - 1/25/2007

Just work backwards.  Create a new test form and just populate a combo and bind it to a BO and work from there adding changes that would match your original form.
By Greg McGuffey - 1/26/2007

I can't get this to work. I have it down to three lines of code for the form:



- In form load I load the bo

- One button click to edit bo

- one button click to undo bo



I've also tried loading combo myself, but that was a disaster. So, could you provide an example of how you would fill a combo from a BO and allow the user to edit the value. I must be doing something wrong in the population settings.
By Trent L. Taylor - 1/26/2007

Have you tried running some of the StrataFrame samples.  For example, the sample CRM Application or StrataFrame UI Controls.  If you can't find anything in here I will create something else, but I would think that we already have a sample somewhere Smile
By Greg McGuffey - 1/29/2007

OK, I'll see what I can find in the samples. This is just frustrating, because it isn't likely code (as there is no significant code in the my test), I can't see any differences between the setup of my combo that doesn't work and other combos that DO work. Crazy



Is there any situation where the population settings would affect this?
By Trent L. Taylor - 1/29/2007

If you can't figure out a solution then create a simple sample using the StrataFrameSample database and post it on the forum.  We can take a look at it and see what is going on.