StrataFrame Forum

Combobox issue

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

By fansanitis - 2/4/2008

I have a table with 4 fields I need to write a maintenance form for:

PK int autoincrement

Category varchar(50)

ProcCode char(5)

Procedure varchar(50)

Unfortunately, this table is poorly designed but I can't change it.  The Category field is NOT unique and can in fact be the same for many rows.  I created a business object for this table along with a maintenance form with all the controls bound to an instance of the BO.  The Category control is a combobox with the dropdownstyle set to dropdown (the default).  I created a method in the BO to return a datatable of the distinct Category values in the table and used it to populate the combobox control.  The Display and Value Members of the combobox are both set to the Category field.  All rows display fine when I navigate through them but if I try to add or edit a row, the textbox portion of the combox control is not editable.  In other words, I must make a selection from the entries the the list portion of the control.  I need to have the user be able to enter a new category in the combobox control.  I thought the dropdownstyle = dropdown allowed this or am I missing something?

Thanks!!   

By Ivan George Borges - 2/4/2008

Hiya.

Yeah, I think that the dropdownstyle is correct. Have you also set the binding property to Text, instead of SelectedValue?

By fansanitis - 2/4/2008

I tried changing the BindingProperty to Text but the text portion of the control still remains "uneditable".
By fansanitis - 2/4/2008

I changed the PopulationType property to manual, declared, loaded and bound a BO to the combobox (cboCategory.DataSource = BO.CurrentTable) and set the comboboxes DisplayMember and ValueMember to the Category field in the BO.  The field values from the manually loaded BO show up in the list portion of the combobox fine but the text portion is still uneditable.  Arrrgh!! 
By Trent L. Taylor - 2/5/2008

Frank,

Do you have the DropDownSTyle of the combo set to DropDown instead of DropDownList?

By fansanitis - 2/5/2008

The DropDownStyle is set to DropDown which I believe should allow the text portion of the control to be editable.  In any event, I've tried all 3 styles and none of them allow editing in the text portion of the control.
By Trent L. Taylor - 2/5/2008

The only other reason that it would not be editable is if the property is read-only.  Can you produce a sample that shows this behavior and post it?  I would like to see first hand what is going on.  Thanks.