RadToolbars ignoring BandIndex in RadToolBarTray

3 posts, 0 answers
  1. Kim
    Kim avatar
    6 posts
    Member since:
    Dec 2013

    Posted 09 Apr 2014 Link to this post

    Hello!

    I have been fighting with this for a day now, and I'm running out of fuel. My main form has a Toolbars-collection containing ToolbarViewModels having properties like Band and BandIndex to bind to. I use the following xaml for my main form:

            <telerik:RadToolBarTray
                   Name="Toolbars"
                   Grid.Row="1"
                   ItemsSource="{Binding Path=Toolbars}"
                   IsLocked="False"
                >

                <telerik:RadToolBarTray.ItemTemplate>
                    <DataTemplate>
                        <telerik:RadToolBar 
                            Band="{Binding Path=Band}"
                            BandIndex="{Binding Path=BandIndex}"
                            ItemsSource="{Binding Path=Elements}"
                              >
                            <telerik:RadToolBar.ItemTemplate>
                                <DataTemplate>

                                 ...this part works, as the toolbars have content

                                </DataTemplate>
                            </telerik:RadToolBar.ItemTemplate>
                        </telerik:RadToolBar>
                    </DataTemplate>
                </telerik:RadToolBarTray.ItemTemplate>
            </telerik:RadToolBarTray>

    As far as I can see, this should work. But what happens is that the last toolbar added to the Toolbars-collection is the topmost, and all other ones end up underneath it & invisible, stacked on top of each other in "Z-order". So in effect what doesn't seem to work is the BandIndex. The BandIndex getter of the view model is also accessed when the toolbar is added.

    I have tried different alignment and content alignment combinations, but all toolbars still end up in the same place.

    Any help appreciated,

    Kim Johnsson
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 10 Apr 2014 Link to this post

    Hi Kim,

    Basically the RadToolBar still does not support binding with ItemsSource. This is described in the following feedback item. We strongly encourage you to define all Toolbars in XAML and avoid setting the ItemsSouce of the RadToolBarTray.

    Regards,
    Petar Mladenov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Kim
    Kim avatar
    6 posts
    Member since:
    Dec 2013

    Posted 10 Apr 2014 in reply to Petar Mladenov Link to this post

    Hello!

    OK, thanks for the answer, I'll check out the thread.

    The idea is that the user can configure the number and content of the toolbars using an xml file, so I will need to create them runtime. But I guess I can just as easily create them programmatically "the oldfashioned way".

    Cheers,

    Kim
Back to Top