jameswong Posted April 20, 2016 Posted April 20, 2016 How to cancel "×" on the lookup field when dropdown Quote
Administrators Farshad Mohajeri Posted April 20, 2016 Administrators Posted April 20, 2016 Set ClearButton -> False. Quote
jameswong Posted April 20, 2016 Author Posted April 20, 2016 i use unidbgrid, does the dbgrid have ClearButton? Set ClearButton -> False. Quote
Sherzod Posted April 20, 2016 Posted April 20, 2016 Hi, On the UniDBLookupComboBox, which is the editor for your lookupfield, For example: UniDBLookupComboBox1.ClearButton => [False] UniDBGrid1.Columns[yourLFieldIndx].Editor => [UniDBLookupComboBox1] Best regards. Quote
jameswong Posted April 20, 2016 Author Posted April 20, 2016 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. Quote
jameswong Posted April 21, 2016 Author Posted April 21, 2016 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" ?! Quote
arilotta Posted December 5, 2017 Posted December 5, 2017 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 Quote
arilotta Posted December 6, 2017 Posted December 6, 2017 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 Quote
Sherzod Posted December 7, 2017 Posted December 7, 2017 Hi, If I understand you correctly, please see this demo: \FMSoft\Framework\uniGUI\Demos\Desktop\GridWithDBLookupCombo Best regards, Quote
arilotta Posted December 7, 2017 Posted December 7, 2017 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.