Results 1 to 3 of 3

Thread: Datagrids - hide column

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    4

    Datagrids - hide column

    Hi,

    Is there a way to hide a column in a datagrid?

    I fill a datagrid with a table from a dataset. But I don't want to see all (customerid is not interesting to see but I need it for relation with other datatables). This is the code to fille the datagrid:

    DGCustomers.DataSource = _
    Database.DS_Customers.Tables("Customers")
    ' refresh the Datagrid
    DGCustomers.Refresh()

    Thanks, kleedje

  2. #2
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

  3. #3
    Addicted Member SaharaWizard's Avatar
    Join Date
    Nov 2004
    Location
    Canada
    Posts
    254

    Lightbulb Re: a better alternative

    I always had the same problem till someone suggested this (on this site):
    1. right click on your datagrid and select edit
    2. select APEND (adding as many columns as you want to actually see in the grid)
    3. right click on the same grid and this time select PROPERTIES
    4. In the columns sections pick columns one by one, give them heading (if you want to do so) and bind them to specific columns from your table (data source).
    This way you get the result much better without having to hide. You can also edit width of the columns wich gave me a major headache before finding this solution.
    SW
    Don't let your schooling get in the way of your education.

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