PDA

Click to See Complete Forum and Search --> : DBgrid question! please...


jeba
Nov 6th, 2000, 09:27 AM
Hi there!
I just want to know how to add items to a datagrid column which has the button. (i.e, button property is checked so that combobox is displayed at the column). For eg, let's say for the datagrid column 'prefix', it should have the following 5 values. 1. Mr 2.Mrs 3. Rev 4. Master 5. Dr
How can I do that? Please provide code. I am using ADO.
Thanx in advance.

AbdulHai Atassi
Nov 6th, 2000, 10:42 AM
Hi..
First at button_click event put the following event:

cboprfx.top= ' you have to populate its position
cboprfx.left= ' you have to populate its position

At combobox click event put the following steps:

datagrid.columns("perfix").text=cboprfx.text
cboprfx.visible=false

jeba
Nov 15th, 2000, 08:33 AM
Hi there!
Thanx for your reply.
I just want to use the built in button that comes with the Datagrid control. Can anyone provide help?
Thanx in advance.

AbdulHai Atassi
Nov 15th, 2000, 10:05 AM
Hello
In the Style tab in propety form of the datagrid select the column you want to put a button to it and then select the checkbox named Button in the bottom of the form. so your column now has a button, and you have also a DataGrid1_ButtonClick(ByVal ColIndex As Integer) event.
select the ColIndex for the column and put the procedure for viewing the combobox. and that is it... enjoy
I hope that i could solve your problem this time.

jeba
Nov 26th, 2000, 03:18 AM
Hi there!
Thanx for the reply. I just want to know how to show some values, when I click the button. So even before adding any record to the database, I want to display the following values when I click the button.
1.Mr
2.Mrs
3.Dr
4.Master
Hope you understand, what I am asking.
Thanx in advance.

AbdulHai Atassi
Dec 1st, 2000, 01:02 PM
Hi Jeba
It is too clearly.
In the ButtonClick event put the code to view the List Control.
The List should contains the values you need to view.
then, when the user click on the list to set a value, hide the list and make the cell value equal to the list value.

If it is not cleare replay to me please.