Results 1 to 6 of 6

Thread: DBGrid hide columns........

  1. #1

    Thread Starter
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542

    Question DBGrid hide columns........

    I have a DBGrid with Columns that I require, however I change the RecordSource to the DBGrid on several occasions this is to save hiding three diferent DBGrids.

    As you can Imagine there are unused columns showing in the dbgrid which means you have to scrole to see parts of the data.

    Is there a way to hide columns on run time?


    thx
    Haven't got anything to say that is the least bit interesting.
    www.tartan-underground.com

  2. #2
    New Member
    Join Date
    Sep 2001
    Posts
    13

    Smile

    set colWidth property=0

  3. #3

    Thread Starter
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542
    Is there not like:


    dbgrid1.column(0).hide or somthing?

    if I hide the columne does that not mean when changing RecordSource I have to make it go back to its orginal size?
    Haven't got anything to say that is the least bit interesting.
    www.tartan-underground.com

  4. #4
    New Member
    Join Date
    Sep 2001
    Posts
    13
    Dim Col1 As Column, Col2 As Column

    Set Col1 = DBGrid1.Columns(0)
    Set Col2 = DBGrid1.Columns(1)

    Col1.Width = 0

  5. #5
    New Member
    Join Date
    Sep 2001
    Posts
    13
    OR INSTED OF SETTING COLWIDTH=0 ,

    YOU CAN SET VISIBLE PROPERTY OF THE COL=FALSE

    COL1.VISIBLE=FALSE

  6. #6

    Thread Starter
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542
    Thx OLa I think I'll go with Visible, havnt got VB on this PC I'll try It at work

    Thx
    Haven't got anything to say that is the least bit interesting.
    www.tartan-underground.com

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