作者:[jiankunking](http://blog.csdn.net/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](https://documentation.devexpress.com/WindowsForms/DevExpressXtraEditors.aspx)
Assembly:DevExpress.XtraEditors.v14.2.dll
### 
Syntax
<table border="1" cellpadding="2" cellspacing="0" style="font-size:undefined; border-collapse:collapse; margin-top:10px; margin-bottom:10px"><tbody style="background-color:inherit"><tr style="background-color:inherit"><td style="word-break:break-all; border:1px solid rgb(153,153,153); padding:5px 16px 5px 12px; min-height:25px; min-width:25px; height:25px; font-family:'Segoe UI',Verdana,Arial; font-size:0.85em; background-color:inherit"><table border="1" cellpadding="2" cellspacing="0" style="font-size:undefined; border-collapse:collapse; margin-top:10px; margin-bottom:10px"><tbody style="background-color:inherit"><tr style="background-color:inherit"><td style="word-break:break-all; border:1px solid rgb(153,153,153); padding:5px 16px 5px 12px; min-height:25px; min-width:25px; height:25px; font-family:'Segoe UI',Verdana,Arial; font-size:0.85em; background-color:rgb(19,100,196)"><div style="min-width:2px; background-color:inherit; color:white; font-family:Arial; font-size:1em; line-height:1.5">C#</div></td><td style="word-break:break-all; border:1px solid rgb(153,153,153); padding:5px 16px 5px 12px; min-height:25px; min-width:25px; height:25px; font-family:'Segoe UI',Verdana,Arial; font-size:0.85em; background-color:rgb(238,238,238)"><div style="min-width:2px; font-family:Arial; font-size:1em; line-height:1.5; background-color:inherit">VB</div></td><td style="word-break:break-all; border:1px solid rgb(153,153,153); padding:5px 16px 5px 12px; min-height:25px; min-width:25px; height:25px; font-family:'Segoe UI',Verdana,Arial; font-size:0.85em; width:422px; background-color:inherit"><div style="min-width:2px; background-color:inherit"><br style="background-color:inherit"/></div></td></tr></tbody></table></td></tr><tr style="background-color:inherit"><td style="word-break:break-all; border:1px solid rgb(153,153,153); padding:5px 16px 5px 12px; min-height:25px; min-width:25px; height:25px; font-family:'Segoe UI',Verdana,Arial; font-size:0.85em; background-color:inherit"><div style="min-width:2px; background-color:inherit"><pre style="font-family:Monaco,Consolas,Courier,'Lucida Console',monospace; line-height:1.5; background-color:inherit">public class DataNavigator : NavigatorBase, IDataNavigatorOwner</pre></div></td></tr></tbody></table>
### 
Remarks
The DataNavigator control is used to navigate through records in a data source and perform operations against the data. It is derived from the[NavigatorBase](https://documentation.devexpress.com/WindowsForms/clsDevExpressXtraEditorsNavigatorBasetopic.aspx) 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](https://documentation.devexpress.com/WindowsForms/DevExpressXtraEditorsDataNavigator_Buttonstopic.aspx) property. To perform custom actions on button clicks, handle the [NavigatorBase.ButtonClick](https://documentation.devexpress.com/WindowsForms/DevExpressXtraEditorsNavigatorBase_ButtonClicktopic.aspx) event.
The DataNavigator control needs to be associated with a data source in order to receive and manipulate data. Use the [DataSource](https://documentation.devexpress.com/WindowsForms/DevExpressXtraEditorsDataNavigator_DataSourcetopic.aspx) and [DataMember](https://documentation.devexpress.com/WindowsForms/DevExpressXtraEditorsDataNavigator_DataMembertopic.aspx)properties 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](https://documentation.devexpress.com/WindowsForms/DevExpressXtraEditorsNavigatorBase_TextLocationtopic.aspx) and [NavigatorBase.TextStringFormat](https://documentation.devexpress.com/WindowsForms/DevExpressXtraEditorsNavigatorBase_TextStringFormattopic.aspx) to customize the display of this text.
地址:[https://documentation.devexpress.com/#WindowsForms/clsDevExpressXtraEditorsDataNavigatortopic](https://documentation.devexpress.com/#WindowsForms/clsDevExpressXtraEditorsDataNavigatortopic)
- 前言
- DEV Gridcontrol 多选
- 关于同步(字典)功能实现的相关积累
- 怎么将输入框控件中的值添加到DataSet中?
- 怎么获得当前行(gridcontrol中)在数据库中某列的值?
- DEV ComboBoxEdit 控件
- Dev Gridcontrol “互联”界面的实现
- DEV ComboBoxEdit控件
- GridView控件 System.NullReferenceException
- Ds中有数据,但Gridview上未显示的原因小结
- VS2010 dev控件 拖拽不到Winfrom上的原因
- DEV Xtratabcontrol中的Xtratabpage
- 在Gridcontrol上选择某一列,并将其删除
- Dev RadioGroup控件:实现单选效果
- Dev Gridcontrol 设置当前行字体
- 控件repositoryItemTextEdit输入不上
- 在GridControl上显示与表A某字段对应的表B字段
- Dev中的repositoryItemButtonEdit控件,双击没反应
- 隐藏GridControl的“Drag a column header here to group by that column”
- DEV GridView显示行号
- DEV Gridcontrol 查询得到0条记录时显示自定义的字符提示/显示
- DateEdit控件时间格式转换
- Dev BarManager控件要通过Remove成员来释放内存
- Dev 显式注册的EvenHandler要显式注销以避免内存泄漏
- Dev 控件绑定的数据源批量操作应避免自动刷新
- Dev Gridcontrl随便单击,都会调用某个方法的原因
- DEV Gridcontrol 格式化显示数据
- DEV gridview 捕获行双击事件
- Dev gridcontrol 捕获按键事件
- DEV GridControl 导出到Excel
- DevExpress GridControl复合表头(多行表头)设置
- Dev gridcontrol获取选定行,指定列单元格的内容
- Dev GridControl 小结
- DevExpress TreeList控件的复选框
- Dev Treelist控件显示行号
- Dev 获取鼠标所在行的索引值
- DevExpress gridview下拉框repositoryItemComboBox的使用
- DevExpress.XtraEditors.DataNavigator用法
- dev gridcontrol 单选框效果
- dev 根据datatable动态生成gridview
- Dev BarManager用法
- Dev GridView RowCellClick事件与MouseDown事件
- Dev 控件中的combox禁止输入
- 在DevExpress GridControl的一列中显示图片
- Dev GridControl 单元格输入数据的验证方法
- dev treelist 常用用法小结
- DevExpress GridView 添加和设置右键菜单
- Dev GridView 绑定List&lt;T&gt;、BindingList &lt;T&gt;、BindingSource
- Dev RadioGroup 用法(项横排显示、项选中)
- DevExpress XtraTreeList的复选框 禁用
