DataGridView列数据绑定 [英] Datagridviewcolumn databinding

查看:83
本文介绍了DataGridView列数据绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,

是否可以使用datagridviewcolumn创建数据绑定
并将其添加到datagridview

我正在尝试创建绑定到数据库表的datagridview,并且我知道您可以将datagridview绑定到特定表.

问题是,该表中有一些组合框,但未在datagridview中显示.
而不是选择客户,我需要放弃一个电话号码.

我本来想创建一个新的类,但是创建新类没有太多经验.

这就是我得到的,我不知道下一步是什么:困惑:C#

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#

<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 />

推荐答案

^ ]吗?

您早先得到了答案.你看到了吗?尝试过吗?
请在一个地方关注这个问题.
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.


这篇关于DataGridView列数据绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆