This question is locked. New answers and comments are not allowed.
I'm trying to display several buttons along side the text for a treeview item.
however the buttons appear directly next to the text instead of to the right as they should be, (see Attached Image)
I've found the following topic which seems to be exactly what i need however it doesn't work.
http://www.telerik.com/community/forums/silverlight/treeview/how-to-stretch-item-horizontally.aspx
Here is my XAML Code for my tree view. I've set the background to check that the target type was correct and to see what space the item takes up.
this is the code for my item template
Setting the grid to stretch also doesn't make any difference. Is it possible to make the content stretch to fill all available space?
Thanks,
Matt
however the buttons appear directly next to the text instead of to the right as they should be, (see Attached Image)
I've found the following topic which seems to be exactly what i need however it doesn't work.
http://www.telerik.com/community/forums/silverlight/treeview/how-to-stretch-item-horizontally.aspx
Here is my XAML Code for my tree view. I've set the background to check that the target type was correct and to see what space the item takes up.
<telerik:RadTreeView ItemsSource="{Binding ReportData}" ItemTemplate="{StaticResource ReportDataTreeTemplate}" SelectedItem="{Binding SelectedReport,Mode=TwoWay}"> <telerik:RadTreeView.ItemContainerStyle> <Style TargetType="telerik:RadTreeViewItem"> <Setter Property="Background" Value="Cornsilk"/> <Setter Property="HorizontalContentAlignment" Value="Stretch"/> </Style> </telerik:RadTreeView.ItemContainerStyle></telerik:RadTreeView>this is the code for my item template
<telerik:HierarchicalDataTemplate x:Key="ReportDataTreeTemplate" ItemsSource="{Binding Reports}" ItemTemplate="{StaticResource Reports}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> <TextBlock Text="{Binding Group.Name}" Grid.Column="0"/> <telerik:RadButton x:Name="EditButton" Command="{Binding DataContext.EditCommand, ElementName=ReportsTab}" CommandParameter="{Binding Title}" Grid.Column="1"> </telerik:RadButton> <telerik:RadButton x:Name="DeleteButton" Command="{Binding DataContext.DeleteReportGroupCommand, ElementName=ReportsTab}" CommandParameter="{Binding Group}" Grid.Column="2"> </telerik:RadButton> <telerik:RadButton x:Name="HideButton" Command="{Binding DataContext.HideReportGroupCommand, ElementName=ReportsTab}" CommandParameter="{Binding Group}" Grid.Column="3"> </telerik:RadButton> </Grid></telerik:HierarchicalDataTemplate>Setting the grid to stretch also doesn't make any difference. Is it possible to make the content stretch to fill all available space?
Thanks,
Matt