Jump to content
uniGUI Discussion Forums
jameswong

How to cancel "×" on the lookup field when dropdown

Recommended Posts

Hi,

 

On the UniDBLookupComboBox, which is the editor for your lookupfield,

 

For example:

UniDBLookupComboBox1.ClearButton => [False]
UniDBGrid1.Columns[yourLFieldIndx].Editor => [UniDBLookupComboBox1]

Best regards.

Share this post


Link to post
Share on other sites

but  i don't use UniDBLookupComboBox1, i create a field which kind is looupup. i see the demo of dbgridlookup( not  UniDBLookupComboBox) which have not clearbutton, how to do that

Hi,

 

On the UniDBLookupComboBox, which is the editor for your lookupfield,

 

For example:

UniDBLookupComboBox1.ClearButton => [False]
UniDBGrid1.Columns[yourLFieldIndx].Editor => [UniDBLookupComboBox1]

Best regards.

Share this post


Link to post
Share on other sites

no, i don't use UniDBLookupComboBox1.I create a field which kind is looupup because i need to display name and save id.  how to  ​cancel "x"

You want to add "x" ?!

Share this post


Link to post
Share on other sites

Hi Delphi Dev, I found this old thread.

I would like to add the "x" to the automatically created DBLookupComboBox when the grid columns are bound to lookup fields.

At the moment, there is no possibility to empty (set NULL) the field, even by clearing the field contents with backspace.

Hoping there is a solution....

Thank you

Share this post


Link to post
Share on other sites

Hi Delphi Dev, 

from your samples, it is possible to bind a Dbgrid column to a lookup field to automatically produce a "DblookupCombo" editor, without the need

to specify explicitely the editor in the Editor property of the column.

This automatically "runtime generated " dblookupcombo does not provide you with the ClearButton, AnyMatch, etc. options.

Is that right ?

However, I've discovered that it is possible to explicitely specify in the Editor property for the column a "design time created" DBLookkupComboBox,

bound with DataSource to the same Grid datasource and DataField to the field underlying the lookup field (key).

In this way it is possible to deeply configure the "design time created" DBLookkupComboBox, using ClearButton, AnyMatch, maybe RemoteQuery, etc.

 

In browse mode, the grid column is filled by the LookupField, while in Edit mode the data editing is managed by the  "design time created" DBLookkupComboBox.

 

Please confirm me that this is a possible solution without any drawbacks, I'm in a hurry because the deadline for the current project I'm working on is coming....

 

Thank you, as always.

Andrea

Share this post


Link to post
Share on other sites

Hi,

 

If I understand you correctly, please see this demo:

\FMSoft\Framework\uniGUI\Demos\Desktop\GridWithDBLookupCombo

Best regards,

Share this post


Link to post
Share on other sites

Thank you for the reply. The demo shows a situation a bit different, and in fact not very common.

In the demo the field posted is "Name", while commonly in a lookup situation it is a numeric identifier (ID).

 

In this situation, to have the user see the name rather than the identifier, the grid column should be bound to a lookup field

to decode the identifier and show the value, correct ?

 

Thank you

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×