WinForms-数据绑定 [英] WinForms - DataBinding

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

问题描述

你好,

此应用程序是带有Dot Net Framework 4.0的WinForm应用程序.

我创建了一个用户控件,该控件在文本框中显示产品线,即产品代码,数量,费率和金额.
此用户控件重复一组文本框以显示每个产品系列的此详细信息.

我想将ProductLines绑定到自定义控件以显示所有产品线.

问题:当我将当前位置设置为下一个位置时,文本框将显示下一个产品线的数据,但是我想一次在窗体上显示所有产品线.如下图所示:

产品系列1:产品代码,数量,费率,金额
产品系列2:产品代码,数量,费率,金额
产品系列3:产品代码,数量,费率,金额
产品系列4:产品代码,数量,费率,金额

我也尝试设置新的BindingContext,但是没有运气.

请让我知道解决方案.预先感谢.

Hello,

This application is a WinForm application with Dot Net Framework 4.0.

I have created a user control which shows product line in text boxes i.e. Product Code, Quantity, Rate and Amount.
This user control repeats set of text boxes to show this detail for each Product line.

I want to bind ProductLines to custom control to show all the product lines.

Problem: When I set current position to next, text boxes show data for the next product line, but I want to show all the product lines on form at a time. Like shown below:

Product Line 1 : ProductCode, Qty, Rate, Amount
Product Line 2 : ProductCode, Qty, Rate, Amount
Product Line 3 : ProductCode, Qty, Rate, Amount
Product Line 4 : ProductCode, Qty, Rate, Amount

I tried setting new BindingContext also but no luck.

Please let me know the solution. Thanks in advance.

推荐答案

我已经使用DataView解决了这个问题!
I have solved this using DataView!


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

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