Jump to content

Problems with unicombobox


ygerdel

Recommended Posts

Hi,

I have a combobox with two columns (City - Code),
it should show both columns but only save one of them (the city). This combobox is assigned as editor of a column in the dbgrid. I should also be able to write the name of the city in case it is not on the list. Using the combobox does not allow me to save only the name of the city because it takes the complete text (name and code) even though I do the following to separate the name of the city before saving:
  UniComboBox1.Text: = Trim (Copy (UniComboBox1.Text, 1, Pos ('-', UniComboBox1.Text, 1) -1));

I tried combobox and dbcombobox and they don't work for me. I can't use the LookUpCombobox because it should let me write the code in case it's not on the list. What are my options?

I attach a test case.

Regards,

GridEditor-TestCase.zip

Captura.JPG.6b76ad3e9980683f091775cd7d50c87a.JPG

Link to comment
Share on other sites

8 hours ago, Sherzod said:

 

 

Hola,

Lo siento por la respuesta tardía.

¿Puedes hacer un caso de prueba simple en VLC para ver lo que querías?


In VLC I cannot assign the combo as editor in the grid column.
1. Is there an option in the dblookupcombbox that allows me to enter and save something that is not in the list?
2. Is there any way that a dbcombobox or a combobox allows me to show 2 columns but save only one?

Regards,

897261766 - AnyDesk 2020-09-14 10-55-20.zip

Link to comment
Share on other sites

4 hours ago, ygerdel said:

could you see the problem? Any ideas?

Maybe something like this?:

UniComboBox.ClientEvents.ExtEvents ->

function select(combo, record, eOpts)
{
    if (combo.getValue().indexOf('-')>-1) {
        combo.setRawValue(combo.getValue().slice(0, combo.getValue().indexOf('-')-1))
    }
}

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...