DataNavigator() Constructor
In This Article
Creates a new DataNavigator object.
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.XtraEditors.v24.2.dll
NuGet Package: DevExpress.Win.Navigation
#Declaration
#Remarks
Use this constructor to create and initialize a new DataNavigator class instance. The constructor initializes the data navigator control with the default settings.
#Example
The following code creates a new DataNavigator control, binds it to a data source, and specifies custom images for control buttons at runtime. Custom images are stored in an ImageCollection object.
using DevExpress.XtraEditors;
private void CreateDataNavigator() {
// Create a new DataNavigator control
DataNavigator dataNavigator = new DataNavigator();
Controls.Add(dataNavigator);
dataNavigator.Height = 40;
dataNavigator.Dock = DockStyle.Bottom;
// Bind to a data source
dataNavigator.DataSource = productsBindingSource;
// Specify the ImageCollection that stores custom images for DataNavigator buttons
dataNavigator.Buttons.ImageList = imageCollection1;
for (int i = 0; i < dataNavigator.Buttons.ButtonCollection.Count; i++) {
dataNavigator.Buttons.ButtonCollection[i].ImageIndex = i;
}
dataNavigator.ShowToolTips = true;
}
See Also