Results 1 to 4 of 4

Thread: datagridview unbound combo?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    datagridview unbound combo?

    in a datagridview, is there a way to add an unbound combo box? in that, you are still able to type in your inputs but also having the ability to choose items from the drop down list?

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

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

    Re: datagridview unbound combo?

    The DataGridViewComboBoxColumn doesn't support that. If you want that behaviour then you'd have to inherit the DataGridViewComboBoxColumn, DataGridViewComboBoxCell and (maybe) DataGridViewComboBoxEditingControl classes and provide it yourself.
    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
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: datagridview unbound combo?

    interesting....thanks

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

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

    Re: datagridview unbound combo?

    Actually, you may be able to handle the EditingControlShowing event and set the DropDownStyle of the EditingControl to DropDown. That's a bit of a hack but it will do the job.
    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

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