Results 1 to 3 of 3

Thread: hiding columns from a form's data grid

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2004
    Location
    Australia
    Posts
    30

    hiding columns from a form's data grid

    Can someone show me how to exclude columns from a DataTable shown by binding it to a form's data grid?
    I can create a DataTable using a SQL statement to get data from an ACCESS database. But, while I want to use all the columns in the DataTable in associated analyses, I want to exclude some columns from the grid for presentational purposes.
    The following code (with the underlying DataSet in 'objDS' and the data grid named 'dgridTable') shows the complete table OK:
    Dim objTable as DataTable
    objTable = objDS.Tables("Details")
    dgridTable.DataSource = objDS
    dgridTable.DataMember = "Details"
    But how do I exclude selected columns from the grid?

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    The easy way is to add a tablestyles to the datagrid and add the desired columns to that.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2004
    Location
    Australia
    Posts
    30
    Lunatic3: Thanks for the help.

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