StrataFrame Forum

DropDownStyle of bound Combobox is always DropDownList

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

By Greg McGuffey - 4/2/2009

I can't seem to get a combo that is bound to have a drop down style other than DropDownList (i.e. only values in list can be selected...no random typing allowed).



This is related to binding. If the combo is unbound, then when the style is set to DropDown, I can type arbitrary values into the combo.



However, if the combo is bound, the style becomes DropDownList (no matter what I set at design time).



I checked the source code (I'm not on the latest beta currently Sad ) and in the BindingEditable property is manipulating the drop down style. I'm thinking it isn't handling the original style correctly and just ends up setting it to drop down list.



The workaround is to set the combo to ignore editing changes and manage that yourself if needed.
By Charles R Hankey - 4/3/2009

Bump



Trent - can this go on the bugfix list (or is it perhaps addressed in latest beta?) Definitely only happens when SF manages the readonly state
By Charles R Hankey - 4/3/2009

This is my current work-around but I am open to suggestion. It seems comboboxes do not have a readonly property so enabled seems the other option. Is there a property that will not dim the cbo if it is disabled?





Private Sub ClientMaintenanceBO1_EditingStateChanged( _

ByVal e As _

MicroFour.StrataFrame.Business.EditingStateChangedEventArgs) _

Handles ClientMaintenanceBO1.EditingStateChanged



Select Case e.EditingState()

Case BusinessEditingState.Editing

Me.cboReferral.Enabled = True

Case BusinessEditingState.Adding

Me.cboReferral.Enabled = True

Case Else

Me.cboReferral.Enabled = False

End Select



End Sub




TIA



Charles
By Trent L. Taylor - 4/4/2009

Do you get the same behavior if you set the IgnoreManageReadonlyState to True?
By Charles R Hankey - 4/4/2009

If you set the ignoremanagereadonlystate to true you get a cbo you can type in but unlike the textboxes, you can type in it when you are not in an editing state. So yes, the managing is what is setting the dropdown to dropdownlist.



So far the code about is the only answer I've found to get the CBO dropdown to behave like other controls (except for it looking disabled when not in editing mode). Not a huge deal, but would probably be good to look at for any refactoring of the managing of edit state in the future. Smile


By Greg McGuffey - 4/7/2009

Bump...this appears to be a bug and I'd like to know if that is the case and that is on the list of fix Tongue
By Trent L. Taylor - 4/8/2009

Greg, this appears to be woking as it should.  Below is a link to a video that shows this in action.  I do recall fixed something in this regard a while back, so you may want to download the most recent beta to see if it resolves the issue in your scenario.

http://www.strataframe.net/downloads/boundcombo.zip

By Charles R Hankey - 4/11/2009

Hi Trent



Just installed the latest Beta and this is indeed working properly. Thanks!



(It may have been fixed earlier than the last build as I just realized I had not installed the January build Blush )
By Trent L. Taylor - 4/13/2009

Glad to hear it...I thought that this had been addressed....thus the head scratching BigGrin
By Geoff Hirst - 5/15/2009

Guys,

I got a weird thing happening, opposite way to the guys above. My concern is that I am on Mondays beta.

I have a combobox set to DropDown - Dropdownstyle. When the record is idle, the control looks exactly how I would expect. Then when I go into Edit mode, it the style changes to Simple. I have tracked this as the control is on a  tab control and I have placed a breakpoint on the selectedpagechanged event and I can see my control has it's dropdownstyle changed.

This is kind of opposite to what the guys are saying above.

I have kind of worked around it by testing the editingstate and I can see that the control is getting changed to simple, and I reset it back to Dropdown.

something is a bit odd here.

thanks in advance (Also more than happy to be told I have done something daft)

best

Geoff.

By Trent L. Taylor - 5/18/2009

Well, thanks to Microsoft and their infinite inconsistency on their combo, we made a change a LONG time ago that swaps the DropDownState based on the editing state so the contol would look the same in a disabled state.  However, I do not think that we ever set it to Simple (I will verify this).  However, I was unable to reproduce the behavior you described.  If you could post a sample reproducing this it would be helpful.  Thanks!