如何将datagrideview列绑定到BindingSource列 [英] how to bind a datagrideview column to BindingSource Column

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

问题描述

我在我的应用程序中使用了datagrid,并且想将datagrid列绑定到bindingsource列,如果可以的话,该怎么办?
即我想要这样

i am using a datagrid in my application and want to bind the datagrid column to a bindingsource column is it posible if so how?
ie i want like this

perTestCtr.DataGrid.Columns["Perameter"].DataPropertyName  = bindingSourceParameter.(column Name of binding source) 


请帮我一个


Please help me some one

推荐答案

您不绑定DGV列,这意味着您可以将多个数据源用于1个DGV,并且这是不可能的.

您应该仅将DGVs数据源设置为bindingsource.如果您具有自动生成列,则将bindinsource列用作列标题,否则可以在定义列时在DGV中设置标题.
You don''t bind a DGV column, this implies that you could use multiple data sources for 1 DGV and that is not possible.

You should be simply setting the DGVs datasource to the bindingsource. If you have auto generate columns the the bindinsource columns are used for the column title otherwise you can set the caption in the DGV when you define the columns.


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

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