This is a migrated thread and some comments may be shown as answers.

RadToolbars ignoring BandIndex in RadToolBarTray

2 Answers 20 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Kim
Top achievements
Rank 1
Kim asked on 09 Apr 2014, 11:38 AM
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 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 10 Apr 2014, 12:58 PM
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.

 
0
Kim
Top achievements
Rank 1
answered on 10 Apr 2014, 02:04 PM
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
Tags
ToolBar
Asked by
Kim
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Kim
Top achievements
Rank 1
Share this question
or