This question is locked. New answers and comments are not allowed.
Hey there -
I am using ContainerBindings with an ItemTemplate to set my HeaderTemplate on my RadTileView. The Tiles are being bound to an ObservableCollection<Tiles> in my viewmodel. My Tiles class exposes a Header property which is a simple string that contains the text to display. Works fine. I want to include some custom buttons in the header (add/edit/delete). First, I figured I'd just change my DataTemplate like so (not a precise example, more for demonstration):
While this displayed my buttons, it didn't quite work as I expected. The width of my wrapper StackPanel was only as wide as the content. What I desire is to have my Add/Edit/Delete on the far right of the header. I played with different elements (stack vs grid etc) and HorizontalAlignments, but no avail.
So I read an article from y'all that described having to edit the ControlTemplate, which allowed me to actually place them right up next to the min/max buttons. Ideal. I *did* do that successfully, but your themes don't work with anything but the defaults, so I lost all styling. I eventually pulled out the XAML from the Metro theme but wasn't seeing my buttons show up even after editing. I'm assuming this is because I'm still applying the theme globally to my app, so it's not taking my local style (defined in RadTimeBarStyle.xaml resource dictionary). What gives? Is there a way to right-align the content within a DataTemplate?
Thanks,
Scott
I am using ContainerBindings with an ItemTemplate to set my HeaderTemplate on my RadTileView. The Tiles are being bound to an ObservableCollection<Tiles> in my viewmodel. My Tiles class exposes a Header property which is a simple string that contains the text to display. Works fine. I want to include some custom buttons in the header (add/edit/delete). First, I figured I'd just change my DataTemplate like so (not a precise example, more for demonstration):
<
DataTemplate
x:Key
=
"TileHeaderTemplate"
telerik:ContainerBinding.ContainerBindings
=
"{StaticResource ContainerBindingCollection}"
>
<
StackPanel x:Name="StackWrap"
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding Header}"
/>
<
StackPanel x:Name="StackButtons"
Orientation
=
"Horizontal"
>
<
Button
Content
=
"Add"
/>
<
Button
Content
=
"Edit"
/>
<
Button
Content
=
"Delete"
/>
</
StackPanel
>
</
StackPanel
>
</
DataTemplate
>
While this displayed my buttons, it didn't quite work as I expected. The width of my wrapper StackPanel was only as wide as the content. What I desire is to have my Add/Edit/Delete on the far right of the header. I played with different elements (stack vs grid etc) and HorizontalAlignments, but no avail.
So I read an article from y'all that described having to edit the ControlTemplate, which allowed me to actually place them right up next to the min/max buttons. Ideal. I *did* do that successfully, but your themes don't work with anything but the defaults, so I lost all styling. I eventually pulled out the XAML from the Metro theme but wasn't seeing my buttons show up even after editing. I'm assuming this is because I'm still applying the theme globally to my app, so it's not taking my local style (defined in RadTimeBarStyle.xaml resource dictionary). What gives? Is there a way to right-align the content within a DataTemplate?
Thanks,
Scott