Results 1 to 4 of 4

Thread: dbgrid column with setting?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091
    My dbgrid will have 1 column. I want to size tha column to the whole width of the dbgrid.

    How can this be accomplished at run time?

    I tried dbgrid.DefColWidth = dbgrid.width, but it doesn't seem to do anything..

    Thanks,

    Dan

  2. #2
    Member
    Join Date
    Jan 2000
    Location
    Quantico, VA, USA
    Posts
    41

    Question

    If your dbgrid only has one column, why not just use a databound list box? then you can resize it to whatever you want. if you're hiding fields on the fly, i could understand that. is that it?
    -chuck
    To err is human, but to apologize frequently is embarassing.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091
    Yes, I'm just showing 1 column.. But can I add/delete records through the Datalist like I can through the dbgrid? Is it done in the same manner or does it require additional code?

    Thanks for any help you can provide..

    Dan

  4. #4
    Member
    Join Date
    Jan 2000
    Location
    Quantico, VA, USA
    Posts
    41

    Post

    Good point. No, you can't edit data the same. You would have to either pop up an inputbox (inputbox() function) to get the data or have a textbox nearby that you could populate with the currently selected item for changing.

    Note that you can't set a column's width property equal to the grid's width property because the grid must surround the column, so it must be bigger. try making the column a little smaller than the grid and see if that works.

    i can't offer much more help than that. sorry.:-(
    -chuck
    To err is human, but to apologize frequently is embarassing.

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