Jump to content

Recommended Posts

Posted

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

Posted
On 9/11/2020 at 8:24 PM, ygerdel said:

I have a combobox with two columns (City - Code),

 

15 hours ago, dkeene said:

Why is this not working?

 

Hello,

Sorry for the late response.

Can you make a simple testcase in VLC to see what you wanted?

Posted
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

Posted
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))
    }
}

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...