DevExpress.XtraEditors.DataNavigator用法

简介: 作者:jiankunking 出处:http://blog.csdn.net/jiankunking1、DevExpress.XtraEditors.DataNavigator刚拖到winform窗体上的样子:设置DataNavigator控件属性Dock=Bottom;TextLocation=End;TextStringFormat=第 {0}页 ,共 {1}页;如果想显示To

作者: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


按钮事件处理:

private void dataNavigator1_ButtonClick(object sender, DevExpress.XtraEditors.NavigatorButtonClickEventArgs e)
        {         
                //下一页
                if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.NextPage)
                {
                }
                //上一页
                if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.PrevPage)
                {
                }
                //首页
                if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.First)
                {   
                }
                //尾页
                if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.Last)
                {
                }
        }


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 the NavigatorBase.TextLocation  and   NavigatorBase.TextStringFormat  to customize the display of this text.

目录
相关文章
Devexpress treelist 控件属性大全
属性列表 1、OptionsSelection: EnableAppearanceForcusedCell:选中的Cell的Appearance设置是否可用。默认为True; EnableAppearanceForcusedRow:选中的Node的Appearance设置是否可用。
1697 0
vs2010中工具箱不显示DevExpress控件的解决办法
vs2010中工具箱不显示DevExpress控件的解决办法 开始安装时,在vs2010中工具箱正常显示开发快车DevExpress10.2控件, 几次打开关闭项目后,有时就出现工具箱中全部或大部分DevExpress控件就不显示了(包括c/s 和b/s项目) 然后在网上搜索,cmd下重新注册后正常:   找到目录D:\Program Files\DevExpress 2010.
2526 0
[UWP]了解模板化控件(7):支持Command
原文:[UWP]了解模板化控件(7):支持Command 以我的经验来说,要让TemplatedControl支持Command的需求不会很多,大部分情况用附加属性解决这个需求会更便利些,譬如UWPCommunityToolkit的HyperlinkExtensions。
946 0
|
测试技术
DoTween的基本用法
DoTween的基本用法 本文提供全流程,中文翻译。Chinar坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 —— 高分辨率用户请根据需求调整网页缩放比例) ...
1979 0
|
测试技术
DoTween用法教程
DoTween用法攻略 本文提供全流程,中文翻译。 Chinar 坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 —— 高分辨率用户请根据需求调整网页缩放比例) Chinar —— 心分享、...
3165 0
|
数据可视化
DoTween可视化编程用法详解
DoTween可视化编辑 本文提供全流程,中文翻译。Chinar坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 —— 高分辨率用户请根据需求调整网页缩放比例) ...
2575 0

热门文章

最新文章