Results 1 to 3 of 3

Thread: [RESOLVED] [2005] add column to datagridview

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2006
    Posts
    734

    Resolved [RESOLVED] [2005] add column to datagridview

    Hi guys,
    I was wondering whether there was anyway to add a column to a datagridview where each cell in that column contains a check box that the user can change the state of as they wish?
    Thanks in advance for any help.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] add column to datagridview

    Do you mean at design time or run time? There is specifically a DataGridViewCheckBoxColumn class. At design time you add a column and then in its properties you set its type to check box. At run time you create a check box column object and add it to the grid's Columns collection. If you bind a DataTable that contains a boolean column to a grid then a check box column will be generated automatically. If you mean you want to add an unbound column to a bound grid then guess what: MSDN has an article dedicated to the subject.

    http://msdn2.microsoft.com/en-us/library/zkatshfa.aspx
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2006
    Posts
    734

    Re: [2005] add column to datagridview

    Thanks found what i needed

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