StrataFrame Forum

ComboBox doesn't respect EditingState

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

By Aaron Young - 4/15/2008

I have a test form with textboxes and a combobox. I notice that the combobox is always enabled regardless of the BO.EditingState. Not a big problem as I know it can be handled in our own code, but I think it would be good if all editable controls respected the BO.EditingState.

Thanks.

By Aaron Young - 4/15/2008

Oops - I spoke too soon. I haven't bound the combobox to a field yet!
By Aaron Young - 4/15/2008

Sorry, it is still doing it after I have setup the combobox. It looks like the combobox is always enabled regardless of BO.EditingState.
By Trent L. Taylor - 4/15/2008

The combobox does follow the EditingState.  The only reason it wouldn't is if:

  1. You have the IgnoreReadonlyState property set to True on the ComboBox
  2. Have the ManageReadonlyState property set to False on the BO
  3. Aren't using an SF combobox.
By Aaron Young - 4/15/2008

Interesting, I am using a SF combobox and have checked your points:-

1. IgnoreManageReadOnlyState = false

2. ManageUIReadOnlyState = true for both the main form BO and the lookup BO

However, I can open the dropdown and select an item when the form is not in edit mode.

By Trent L. Taylor - 4/15/2008

Well, then you have something else in the mix...this is a very basic control and basic functionality.  I know for a 100% fact that this control follows the editing state of the BO when bound...oh, that would be a 4th point BigGrin (and the most basic one)

Do you have the control bound to a BO and binding field?

By Aaron Young - 4/15/2008

Binding to a BO field may be the most basic point but guess which dummy didn't do it? Smile

I really didn't know what I was doing and originally bound to the field and ran the form without realising I had to setup the PopulationDataSourceSettings. It threw an error so I removed the binding and setup the PopulationDataSourceSettings. Of course the drop-down worked but it wasn't bound to the BO.

Now that I have bound to a field, guess what is working now? 10 points to you and a "fail" for me Smile

By Aaron Young - 4/15/2008

By the way, is there anyway to show two fields when the drop-down is opened but only one field with the drop-down is closed?

I tried using the "Drop-Down Display Format String (Combo Only)" option but it didn't appear to do anything.

Thanks.

By Ivan George Borges - 4/15/2008

Hi Aaron.

Try something like this:

By Aaron Young - 4/15/2008

Hi Ivan,

I tried that and it doesn't work for me. All I see is whatever I have in the Display Member Format String box. If I do {1}{0} in Display Member then I see the two columns when the combobox is both open and closed. The Drop-Down Display Format String doesn't appear to do anything for me.

Maybe I am missing a property on the combobox to make this work?

Thanks anyway.

By Greg McGuffey - 4/15/2008

I believe the format for the multi-column is:



{0}|{1}



Don't forget that vertical bar!
By Trent L. Taylor - 4/15/2008

You have to set the UseMultiColumns property to True and define the columns in the columns collection.  If you are looking at teh property sheet in category mode, it should be the last category of the combo towards at the vert bottom.  If you use the category view instead of the alphabetical view, it might help you learn more quickly what the SF properties are and find the SF categories versus the standard properties.
By Aaron Young - 4/17/2008

Thanks everybody for your help. I now have a multi-column combobox Smile
By Greg McGuffey - 4/17/2008

Cool! BigGrin
By Trent L. Taylor - 4/17/2008

Glad you got it working! Wink
By Aaron Young - 4/17/2008

The combobox or my brain? Smile
By Trent L. Taylor - 4/17/2008

LOL....the combobox...I think that your brain is functioning very nicely! BigGrin