StrataFrame Forum

Combobox reverts to look and feel of a textbox

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

By Aaron Young - 7/3/2009

Hi,

I have a couple of manually populated comboboxes that most of the time behave normally. Sometimes, when the form enters Edit mode the dropdown element on the controls disappears and the controls effectively look like text boxes with no dropdown list.

Most of the time the controls work and there doesn't appear to be a reason or pattern to when they fail. The combobox always looks okay when the business object is idle - it just happens when the business object enters edit mode.

Has anyone seen this before?

Thanks,

Aaron

By Aaron Young - 7/8/2009

Hi,



I can now make this happen 100% of the time and the control is changing the ComboBoxStyle when entering edit mode.



It appears to only affect combos that are manually queried as other comboboxes on the same form that are populated on form load are okay. When I add a new record, then save, then edit, the manually queried comboboxes change from DropDownStyle = ComboBoxStyle.DropDown to DropDownStyle = ComboBoxStyle.Simple.



I have checked and the combobox lists are full at the point the BO enters edit mode. When the BO editing state is idle the comboboxes are set as ComboBoxStyle.DropDown. When the BO enters edit mode they change to ComboBoxStyle.Simple and then revert back to ComboBoxStyle.DropDown when the BO is idle again.



It looks like the combobox is deciding to change the ComboBoxStyle only while editing and I can't see a reason for it.



Aaron


By Trent L. Taylor - 7/8/2009

Actually the SF combo box has done this since nearly the beginning of time because the appearance of the combo is different when disabled (as it doesn't have a read-only mode) and there were complaints initially of the appearance not matching. However, the combo does look more like a textbox when disabled in different modes, so we actually change this.



However, with that being said, this is the first I have heard of it not changing back correctly (in a really long time). There was an issue a really long time ago when this change was made that under certain conditions you would get the behavior you are explaining. Can you reproduce this in a simple sample or is it environment specific.



If you can produce a sample reproducing this then we can make sure that it is resolved before we release the 1.7 build.
By Aaron Young - 7/8/2009

I will try and create a test project to recreate it.



The strange thing is the combobox is correct when disabled and incorrect when enabled. It looks like a combobox when disabled and a text box when enabled.

I will build in some code to automatically check the dropdownstyle in the meantime.



Thanks,



Aaron