Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey,

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#
C#
public partial class column : DataGridViewComboBoxColumn
    {
        public column()
        {
            InitializeComponent();
        }
        public column(IContainer container)
        {
            container.Add(this);
            InitializeComponent();
        }
        BindingSource binding;
        public BindingSource Binding
        {
            get { return binding; }
            set { binding = value; }
        }
    }
Posted
Updated 5-Oct-10 20:11pm
v3

1 solution

Without your explaining your reasons for designing your own column it is not possible to say if that is the best approach.

Still, for help in doing just that try these two articles:

Code Magazine[^]
MSDN[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900