Bug Report Q347737
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

Looking for NavBarItem binding example

The example that demonstrates NavBarControl within the MVVM pattern (E3541) does not work properly

created 14 years ago

I'm trying to bind my NavBarControl to my ViewModel with a IList. I've found the documentation for a DataTable, but I don't want to use a DataTable and I can't find anything on List/Collection.
My problem is that I can't get any of the NavBarItems to populate under the groups. Not sure if I'm not binding it right or I need to change my IList.
        <dxn:NavBarControl HorizontalAlignment="Left" Name="navBarControl1" VerticalAlignment="Top" Height="300" Width="300"
                           ItemsSource="{Binding Path=NavigationBarContent}" GroupDescription="DisplayName">
            <dxn:NavBarControl.Resources>
                <Style TargetType="{x:Type dxn:NavBarGroup}">
                    <Setter Property="Header" Value="{Binding}"/>
                </Style>
                <Style TargetType="{x:Type dxn:NavBarItem}">
                    <Setter Property="Content" Value="{Binding}"/><!--Didn't know what to put here, so it just binds the groups name-->
                </Style>
            </dxn:NavBarControl.Resources>
        </dxn:NavBarControl>

Comments (2)
DevExpress Support Team 14 years ago

    Hello Brian,
    Thank you for the question. We have a code example regarding your question. Please take a look at it: How to generate groups and items via ItemsSource. Let me know if you need any additional assistance.
    Thanks,
    Alexander.

      Hello Alexander,
      That example helps, but I've got one question about it. Why does it populate one more additional navbaritem for each group?
      Group 0
        -Group 0, Header 0
        -Group 0, Header 1
        …
        -Group 0, Header 8
        -Group 0, Header 9
        -Group 0 //Why does it add this navbaritem?

      Answers

      created 14 years ago (modified 11 years ago)

      Hello Brian,
      Thank you for the update. I have reproduced the problem you reported. It looks like a bug in NavBarControl. I have converted this issue to a bug report. We will fix it as soon as possible. Please accept our apologies for the inconvenience.
      To resolve this problem immediately, I have created a different solution for you, which contains special cross-platform attached behavior. This solution operates fine.
      Thanks,
      Alexander.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.