Back to Devexpress

NavBarControl.ItemsSource Property

wpf-devexpress-dot-xpf-dot-navbar-dot-navbarcontrol-ed67ee63.md

latest4.5 KB
Original Source

NavBarControl.ItemsSource Property

Gets or sets the data source that is used to generate the content of the NavBar control.

Namespace : DevExpress.Xpf.NavBar

Assembly : DevExpress.Xpf.NavBar.v25.2.dll

NuGet Package : DevExpress.Wpf.NavBar

Declaration

csharp
public IEnumerable ItemsSource { get; set; }
vb
Public Property ItemsSource As IEnumerable

Property Value

TypeDescription
IEnumerable

A data source object that implements the IEnumerable interface.

|

Remarks

Use the ItemsSource property to populate the NavBar control with groups and items taken from the specified data source. When the NavBar control is bound to a data source, data source items are represented by NavBar items organized in groups, dependent on the NavBarControl.GroupDescription property setting.

If the NavBar is bound to a data source, its NavBarControl.Groups and NavBarGroup.Items collections are populated implicitly, have a fixed size and cannot be explicitly modified.

During data binding of a NavBar element (a group or item), the corresponding event (NavBarViewBase.GroupAdding or NavBarViewBase.ItemAdding) is generated, allowing you to access the created element’s data source item (see the event argument’s ElementAddingEventArgs.SourceObject property).

The following code snippets (auto-collected from DevExpress Examples) contain references to the ItemsSource property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-spreadsheet-how-to-apply-conditional-formatting-to-a-range-of-cells/CS/ConditionalFormatting_WPF_Examples/MainWindow.xaml#L39

xml
<Label Content="Double-click the action name on the left to run the example" FontSize="18" Grid.ColumnSpan="2" Grid.Row="0"/>
<dxn:NavBarControl Name="navBarControl1" Grid.Column="0" Grid.Row="1" ItemsSource="{Binding}" >
    <dxn:NavBarControl.View>

wpf-spreadsheetcontrol-api-part-1/CS/SpreadsheetControl_WPF_API/MainWindow.xaml#L37

xml
<Label Content="Double-click the action on the left to run the example" FontSize="18" Grid.ColumnSpan="2" Grid.Row="0" Padding="5" />
<dxn:NavBarControl Name="navBarControl1" Grid.Column="0" Grid.Row="1" ItemsSource="{Binding}">
    <dxn:NavBarControl.View>

wpf-spreadsheetcontrol-api-part-2/CS/SpreadsheetControl_WPF_API_Part02/MainWindow.xaml#L36

xml
<Label Content="Double-click the action name on the left to run the example" FontSize="18" Grid.ColumnSpan="2" Grid.Row="0" />
<dxn:NavBarControl Name="navBarControl1" Grid.Column="0" Grid.Row="1" ItemsSource="{Binding}">
    <dxn:NavBarControl.View>

See Also

GroupDescription

ReloadGroups()

NavBarControl Class

NavBarControl Members

DevExpress.Xpf.NavBar Namespace