Results 1 to 3 of 3

Thread: DBGrid columns and getting data out

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Location
    Littlehampton, W Sussex GB
    Posts
    203

    Post

    How do I add or delete DBGrid columns - also when I double click on a DBGrid line I want to be able to put information from a column on the line I've clicked into a string - I know this sounds easy but I've not dome it before and have tried a few things without success - thanks

  2. #2
    Junior Member
    Join Date
    Jan 1999
    Location
    Seattle WA USA
    Posts
    21

    Post

    I used the VB5 DBGrid extensively in my last app. Some of its shortcomings didn't become apparent to me until after I'd already delivered the app to the client, but I digress.

    The means to add or remove columns in a DBGrid is fairly well hidden. Right click on the DBGrid and a popup menu appears. Choose Edit from this menu and then you can delete, insert and append columns. I would try to give you more detailed info than this, but it would probably just be confusing. What I'd do is just start a blank project with a DBGrid in it and start doing trial and error until you get the feel of it. That way you won't wind up destroying what you have set up.

    As to getting at data in the grid: you can use the Columns method. DBGrid1.Columns(0) references the data in the first field of the current row. Columns(1) is the next field, and so on. The current row is available as the Row property: DBGrid1.Row, and you can manipulate that directly in code.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Location
    Littlehampton, W Sussex GB
    Posts
    203

    Post

    Thanks a lot - its obvious once you know how - that was driving me crazy

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