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


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
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?



StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
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).
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
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!
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Oh, when using this, do I bind the Text property instead of the SelectedValue property?
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
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.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
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?
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 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.
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
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.
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
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
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
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?
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