BindingNavigator & BindingSource Classes in VS2005

博客介绍了VS2005中的BindingNavigator和BindingSource类。BindingNavigator类代表绑定到数据的表单控件的导航和操作界面,BindingSource类封装表单的数据源,二者常配对使用以操作表单数据记录。还给出了代码示例及BindingNavigator构造函数说明。

BindingNavigator & BindingSource Classes in VS2005

 <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

BindingNavigator Class represents the navigation and manipulation user interface for controls on a form that are bound to data.

 

BindingSource Class encapsulates the data source for a form.

 

In most cases, a BindNavigator is paired with a BindSource control to move through data records on a form and interact with them.

 

Code snippet:

private BindingSource EmployeesBindingSource;

// Create a BindingSource for all the BindingNavigators to use

this.EmployeesBindingSource = new BindingSource();

// Associate the DataSet with the BindingSource.

this.EmployeesBindingSource.DataMember = "Employee";

this.EmployeesBindingSource.DataSource = ds;

 

// Associate the BindingNavigators with the BindingSource

this.EmployeesBindingNavigator.BindingSource = this.EmployeesBindingSource;

 

BindingNavigator Constructor:

public BindingNavigator( bool addStandardItems );

addStandardItems

true to show the standard VCR-like navigational UI; otherwise, false.

BindingNavigator.jpg

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值