Link to home
Start Free TrialLog in
Avatar of junlabao
junlabao

asked on

dbgrid buttonclick code sample

I'd just want to have some sample code wherein you use the buttonclick event of a dbgrid that will pulldown a combo box and then update the contents of the column (with the button) based on the user selection.
Avatar of DarkAge
DarkAge

What version 4 or 5?
Could you B more explicit ?
You have a DBGrid, a button and a ComboBox ?
And so what ?
Avatar of junlabao

ASKER

I'm using VB 5.  I've got both a dbgrid and a combox control.  In the office, we deal with a lot of codes such as product codes, client codes, ..., etc.  It would really help if we are able to let users click a button from a column in a dbgrid and he will be presented with the available codes from a combo box.  Since I've gathered that it is impossible to put a combobox in a dbgrid control (ala Access in datasheet view), we are stumped on how to do this.  I've checked and there is a property in the dbgrid wherein you you are able to specify to show a button whenever the column in the dbgrid has the focus.  Based on the help files, once the button is clicked a "buttonclick event" will be trigered and you can add code to pulldown a combo box.  The problem is that help doesn't have any sample code.
ASKER CERTIFIED SOLUTION
Avatar of Jagar
Jagar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It would be best if you can provide me with sample code for the buttonclick event of the bounded dbgrid.  How would I let the code know which column currently has the focus (since you will copying the contents of the combobox to the column with the button)?