Results 1 to 6 of 6

Thread: DBgrid question! please...

  1. #1

    Thread Starter
    Hyperactive Member jeba's Avatar
    Join Date
    Feb 2000
    Posts
    265
    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.
    J

  2. #2
    New Member
    Join Date
    Nov 2000
    Location
    Syria - Homs
    Posts
    4
    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
    A.T.Atassi

  3. #3

    Thread Starter
    Hyperactive Member jeba's Avatar
    Join Date
    Feb 2000
    Posts
    265

    Thanx..but

    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.
    J

  4. #4
    New Member
    Join Date
    Nov 2000
    Location
    Syria - Homs
    Posts
    4

    DataGrid Button

    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.
    A.T.Atassi

  5. #5

    Thread Starter
    Hyperactive Member jeba's Avatar
    Join Date
    Feb 2000
    Posts
    265

    Yes, You are right! but...

    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.
    J

  6. #6
    New Member
    Join Date
    Nov 2000
    Location
    Syria - Homs
    Posts
    4
    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.
    A.T.Atassi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width