Subject | Re: [IBO] How to show button in IB_ComboBox? |
---|---|
Author | russellbelding |
Post date | 2013-02-03T21:04:47Z |
Thanks for the hint Helen .. below
--- In IBObjects@yahoogroups.com, Helen Borrie wrote:
>
> At 04:59 p.m. 2/02/2013, you wrote:
> >Using IBO 4.9.9 in D2010 and Firebird 2.5.x
> >I have a TIB_LookupCombo (LC) for a text field inside a TIB_Grid (Grid).
> >The combo box is in col 2. When a single mouse click is made to col 2 the cell selected is painted. A second click is required to show the combo box's dropdown button. A click on the button will drop down the selection list.
> >
> >I would like the dropdown button to appear when a col 2 cell is clicked, to show the user there is something here to be selected.
> >
> >I have tried several things without success.
> >In Grid AlwaysShowEditor=True, EditLinksAuto=True. I know AlwaysShowEditor is for BlobFields.
> >
> >In LC showButton returns True and seems to do nothing visible.
> >
> >Any suggestions for me from fellow users?
>
> Is the dataset certain to be in an editing mode (insert/edit) at the time? The dropdown is activated only in those modes...so possibly your solution would be to test dsEditing (and/or dsInserting, if needed) in the initial click event and put the dataset into Edit if it's false.
>
> Helen
>
The Grid uses datasource ds which uses dataset qr, a TIB_Query.
grid <-- ds <-- qr.
The ds changes state when clicking from one grid row to another.
I can push the ds into edit mode using ds.Edit.
When on a row and I click to the column of the row with the lookupcombo LC the LC button appears immediately. That is desireable and what I want.
When I click into the LC column on another row I need to click into the column a second time to get the LC button to appear. This is the (minor) problem.
I know the col number of the LC column (2). In the grid.CellClick event I can force ds.Edit when this col is entered. But this does force the LC button to show. A second click is required.
I guess managing events for the grid, ds and qr needs more care than I am giving it to date. An experiment shows my code is causing the problem. I use ds.DataChange. If I exit this procedure immediately upon entering it I get the desired behaviour. So I need to sort this out.
Russell