Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2003
    Location
    Australia
    Posts
    217

    Question Unanswered: Is there a way to put Combo boxes in a DataGrid ?

    Hi VB6 gurus,

    Is there a way to put Listboxes or Combo Boxes in a DataGrid,
    so that I may fill them up with Lookup table data and then
    users may select items from them ?

    Thank you very much in advance.

    _______
    Lepanto

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Which version of VB?
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  3. #3
    Join Date
    Jul 2003
    Location
    Australia
    Posts
    217
    Version 6, ie VB6.


    _______
    Lepanto

  4. #4
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Here's an approach for the lookup column.

    And, here, at an INet sister site, there's a long thread with code samples for using the flexgrid/mshFlexgrid. One of the posts shows how to add combo boxes to the column header. You may be able to adapt the same technique to individual entire columns.
    Last edited by loquin; 09-18-08 at 16:09.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  5. #5
    Join Date
    Jul 2003
    Location
    Australia
    Posts
    217

    Thanks, but...

    Thanks, I tried that method, it is not bad.

    But there is another problem with the DataGrid, whenever I selected values
    from the combo and list boxes (for the DataGrid) , it would not save the record but showed an error message saying "INVALID ROW NUMBER".

    Do you have any idea how to fix this ?
    Thanks.

    (It seems that the DataGrid is not powerful, not flexible and not user-friendly...)

    _______
    Lepanto

  6. #6
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    It really depends on the underlying joins and table structure. How are you populating the grid? Seeing your code would be helpful.

    As far as the datagrid... It is an older control, and it doesn't have all the 'bells and whistles' that newer controls, like the mshFlexgrid, or sGrid has. And, its harder to access some of the internal 'works' than with the flexgrid. That being said, on the other hand, it is both lighter (memory,) and substantially faster to load than the flexgrid. So, I would say that it is more 'powerful', but less flexible as the flexgrid. If you don't need custom formatting or new features, it is just as easy, if not easier than the flexgrid. But, if you need non standard features, it is less friendly.

    As with most things technology related, there are trade-offs involved, and you need to know what the trade-offs are before deciding which to use.

    Take ADO Data Controls for instance. They are easy to use. (They can be codeless, in fact.) However, they are inflexible, resource intensive, and bound to a very old version of ADO. So, if you need to do anything 'out of the ordinary,' you have to jump through hoops to get it done, if it is doable at all. Since it's so easy to bypass them and use ADO directly, I would never recommend their use to anyone.
    Last edited by loquin; 09-19-08 at 14:41.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  7. #7
    Join Date
    Jul 2003
    Location
    Australia
    Posts
    217
    Thanks for the information.

    I got another question: can MSHFlexGrid be used for data entry ?
    It seems that it is only for record display, isn't it ??


    ________
    Lepanto

Posting Permissions

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