[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DataComboView: How to get record chosen from the drop-down


On 5/20/25 10:56 AM, Benoît Minisini wrote:
Le 20/05/2025 à 15:20, Lee a écrit :
On 5/20/25 7:56 AM, Benoît Minisini wrote:
Le 19/05/2025 à 20:28, Lee a écrit :
I simply cannot figure out how to determine what record was chosen from the DataComboView drop-down list (the DataView).

DataComboView.Value doesn't change. The DataSource.Index doesn't change.

I find no DataComboView_Change or _Activate events, so I'm using _MouseDown (_MouseUp doesn't get raised).

Am I doing something wrong? (Project attached.)



No. Apparently the DataComboView was intended to be put inside a DataSource only, and not to be used alone.

This control needs some enhancements for that.


Thank you for the response, Benoît. But, I am confused because I did have the DataComboView inside a DataSource (as in the project I sent).


Now I am even more confused.

It is supposed to act on its own.

Above you said it is not to be used alone. I guess I don't know what "act on its own" means. If it means outside a DataSource, then how would the control know what connection to use?


< It has a 'Field' property that must be a field of the DataSource table, and that must be a
foreign key to another table defined in its 'Table' property.

It sounds here as though you are talking about the DataCombo:
"This control lets you edit the value of a field through another table whose primary key is that field."

not the DataComboView:
"This control implements a combo-box that allows user to choose a record inside a table."


Of course, I can add some 'Click' event if you need to use it alone.

The phrase, "use it alone", according to what I have read above would mean NOT inside a DataSource. I don't know how a 'Click' event would help the DataComboView know what connection to use outside of a DataSource.


What would be useful to me is to have the DataComboView do exactly what it claims it does but with some mechanism to determine what record was chosen by the user.

But, this thread can be put to rest. There ways to accomplish what I need other than using DataComboView. Thank you for trying.


--
Lee

--- Gambas User List Netiquette [https://gambaswiki.org/wiki/doc/netiquette] ----
--- Gambas User List Archive [https://lists.gambas-basic.org/archive/user] ----


References:
DataComboView: How to get record chosen from the drop-downLee <t.lee.davidson@xxxxxxxxx>
Re: DataComboView: How to get record chosen from the drop-downBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: DataComboView: How to get record chosen from the drop-downLee <t.lee.davidson@xxxxxxxxx>
Re: DataComboView: How to get record chosen from the drop-downBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>