Results 1 to 7 of 7

Thread: [RESOLVED] When creating multiple datagridview controls at runtime, how do you hide columns?

Hybrid View

  1. #1
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,413

    Re: When creating multiple datagridview controls at runtime, how do you hide columns?

    Quote Originally Posted by dunfiddlin View Post
    No. There's a problem with you not adding columns to the DGV correctly (or at all?) At least that's what I'm assuming without the relevant code to check. Declare a New DataGridViewColumn (I think that's the right nomenclature, I'm flying blind at the moment. Assign values to it properties. Add it to the DGV. Then do the same all over again for each other column.
    No. the OP has set the datasource for the dgv which creates the columns, but they aren't named as the OP is expecting...

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: When creating multiple datagridview controls at runtime, how do you hide columns?

    Quote Originally Posted by .paul. View Post
    No. the OP has set the datasource for the dgv which creates the columns, but they aren't named as the OP is expecting...
    Oh right. Missed that line. Should've gone to Specsavers!
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2012
    Location
    Las Vegas, NV
    Posts
    41

    Resolved Re: When creating multiple datagridview controls at runtime, how do you hide columns?

    Aha! I figured it out. I had to move the following line:

    Code:
    tabNewCheckpoint.Controls.Add(dgvNewCheckpoint)
    immediately below the following line:

    Code:
    tabctrlTimingTable.TabPages.Add(tabNewCheckpoint)
    Wow, what a struggle! Thanks for your help though!

Tags for this Thread

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