Results 1 to 3 of 3

Thread: Hide columns in DataGrid

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2006
    Posts
    169

    Hide columns in DataGrid

    Dear friends,

    I have 5 fields in Table Items.I created DataGrid to view the table.
    I have 5 cols. as follows.

    code,name,uom,desc and stock.

    But I don't want to display all the columns.I want to display only
    code,name and stock.How to hide other cols, Please help me to do!

  2. #2
    Hyperactive Member Bearnerd's Avatar
    Join Date
    Apr 2006
    Location
    Malaysia
    Posts
    290

    Re: Hide columns in DataGrid

    Why don't you just query the needed column when opening a recordset?

    VB Code:
    1. sSql = "SELECT code,name,stock FROM [TABLE]"
    2.     rec.Open sSql, con, adOpenDynamic, adLockOptimistic
    3.     rec.CursorLocation = adUseClient
    4.     Set DataGrid1.DataSource = rec

  3. #3
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    Re: Hide columns in DataGrid

    I have used flexgrids and just set the col width to 0. Never tried it with a data grid.

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