Results 1 to 5 of 5

Thread: Datagrid ... Please

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Location
    South Africa
    Posts
    88

    Datagrid ... Please


    Please help. I want to Hide a column in my Datagrid after I have set the Grids datasource to a dataset.
    High hopes go to all that looks down!!!

  2. #2
    Addicted Member
    Join Date
    Feb 2002
    Location
    closed
    Posts
    196
    might be a better way out there but you could consider using a dataview as the source...

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Location
    South Africa
    Posts
    88
    Thanx powdir. What I want to do is to create an inner join, Then on my main Form have Textboxes for the main table and a datagrid for the table joined with the main table. The datagrid's datasource is set to the datatset. So what happens is the datagrid is showing both tables and the text boxes are showing the main table. Thats why I need to hide some columns.
    High hopes go to all that looks down!!!

  4. #4
    Addicted Member
    Join Date
    Feb 2002
    Location
    closed
    Posts
    196
    Ok...kinda with you, but if your datagrid is displaying fields that are already displayed via textboxes why not use a dataview as i suggested to filter out these duplicates fields and then set the datagrid's datasource as the dataview...Cheers

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    try this ...!
    from MS VS Documentation

    VB Code:
    1. Dim ColumnIndex As Integer = 1
    2. ' Remove the second column
    3. Dim myGridColumns As GridColumnStylesCollection
    4. myGridColumns = DataGrid1.TableStyles(0).GridColumnStyles
    5. myGridColumns.RemoveAt(ColumnIndex)

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