打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
DevExpress.XtraEditors.DataNavigator用法

作者:jiankunking 出处:http://blog.csdn.net/jiankunking

1、DevExpress.XtraEditors.DataNavigator刚拖到winform窗体上的样子:


设置DataNavigator控件属性Dock=Bottom;TextLocation=End;TextStringFormat=第 {0}页 ,共 {1}页;

如果想显示ToolTip,需把ShowToolTips设置为True.设置Button的Hint为自己想要显示的内容即可。
比如:

在运行时会有下面效果:


上图中的首页、前一页、后一页、尾页的图片是自定义的,那么怎么使用自定义图片呢?
拖拽一个imageList控件,然后在imageList中选择要使用的自定义图片

然后在Buttons选项卡下将ImageList设置为刚才选择过图片的imageList1控件,然后在DataNavigator控件 buttons下选择荼盘即可,比如下图的First


按钮事件处理:

[csharp] view plain copy
  1. private void dataNavigator1_ButtonClick(object sender, DevExpress.XtraEditors.NavigatorButtonClickEventArgs e)  
  2.         {           
  3.                 //下一页  
  4.                 if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.NextPage)  
  5.                 {  
  6.                 }  
  7.                 //上一页  
  8.                 if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.PrevPage)  
  9.                 {  
  10.                 }  
  11.                 //首页  
  12.                 if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.First)  
  13.                 {     
  14.                 }  
  15.                 //尾页  
  16.                 if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.Last)  
  17.                 {  
  18.                 }  
  19.         }  


dev官方文档:

DataNavigator Class


The control that enables navigation through records in a data source and provides common record operations.

Namespace:DevExpress.XtraEditors
Assembly:DevExpress.XtraEditors.v14.2.dll

 Syntax

C#
VB

public class DataNavigator : NavigatorBase, IDataNavigatorOwner

 Remarks

The DataNavigator control is used to navigate through records in a data source and perform operations against the data. It is derived from theNavigatorBase class, and so it inherits properties and methods common to all data navigation controls.

The data navigator displays built-in buttons that enable a user to scroll forward or backward through records one at a time, Go to the first record, go to the last record, insert a new record, post data changes, cancel data changes and delete a record. You can also add custom buttons, when required. To access built-in and custom buttons, use the Buttons property. To perform custom actions on button clicks, handle the NavigatorBase.ButtonClick event.

The DataNavigator control needs to be associated with a data source in order to receive and manipulate data. Use the DataSource and DataMemberproperties for binding.

The DataNavigator can display a text string that specifies the current record and the total record count in the associated data source. Use theNavigatorBase.TextLocation and NavigatorBase.TextStringFormat to customize the display of this text.


本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
DevExpress入门教程
DevExpresss LookUpEdit详解
DevExpress.dataNavigator.tooltip属性
基于DevExpress开发的GridView如何实现一列显示不同的控件类型
Winform开发框架之对话框样式同化
C# devexpress gridcontrol 分页 控件制作
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服