Click here to Skip to main content
14,211,690 members
Rate this:
Please Sign up or sign in to vote.
See more:

Is it possible to create a databinding with a datagridviewcolumn
and add it to a datagridview

I'm trying to create a datagridview that is binded to a database table, and i know that you can bind the datagridview to a specific table.

the problem is, that the table has some comboboxes in it but they aren't shown in the datagridview.
Instead of chosing a customer I need to give up a number.

I thought to create a new class, but I don't have that much experiance with creating new classes.

this is what i got i don't know whats next:confused: C#
<pre lang="cs">public partial class column : DataGridViewComboBoxColumn<br />
    {<br />
        public column()<br />
        {<br />
            InitializeComponent();<br />
        }<br />
        public column(IContainer container)<br />
        {<br />
            container.Add(this);<br />
            InitializeComponent();<br />
        }<br />
        BindingSource binding;<br />
        public BindingSource Binding<br />
        {<br />
            get { return binding; }<br />
            set { binding = value; }<br />
        }<br />
    }</pre><br />

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Any specific reason why you repost [^]it?

You got an answer earlier. Did you look at it? tried?
Please follow the question at one place.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Advertise | Privacy | Cookies | Terms of Service
Web01 | 2.8.190619.2 | Last Updated 6 Oct 2010
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100