Hi,
I have a RadGridView containing a GridViewColumn which contains four 'action' buttons.
In the view model I set the visibility of the 'action' buttons.
This works well in the sense that the buttons are displayed or hidden in the grid.
But the 'Action' column with always takes into account the total width of all four buttons even when some of them are not displayed.
How can I get the GridViewColumn to only take up as much space as the actual displayed buttons?
Thanks,
Peter
I have a RadGridView containing a GridViewColumn which contains four 'action' buttons.
<
telerik:GridViewColumn
Header
=
"{x:Static commonResources:CommonResources.ActionColumn}"
>
<
telerik:GridViewColumn.CellTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
bc:RadGridViewActionButton
NormalImage
=
"../Images/dgy_040_edit_normal.png"
MouseOverImage
=
"../Images/bk_040_edit_normal.png"
Visibility
=
"{Binding Path=DataContext.IsModifySupported, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}, Converter={StaticResource BooleanToVisibilityConverter}}"
ToolTip
=
"{Binding Path=DataContext.ModifyCommandToolTip, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}}"
Command
=
"{Binding Path=DataContext.ModifyCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}}"
/>
<
bc:RadGridViewActionButton
NormalImage
=
"../Images/dgy_200_details_normal.png"
MouseOverImage
=
"../Images/bk_200_details_normal.png"
Visibility
=
"{Binding Path=DataContext.IsViewSupported, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}, Converter={StaticResource BooleanToVisibilityConverter}}"
ToolTip
=
"{Binding Path=DataContext.DetailsCommandToolTip, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}}"
Command
=
"{Binding Path=DataContext.DetailsCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}}"
/>
<
bc:RadGridViewActionButton
NormalImage
=
"../Images/dgy_030_delete_normal.png"
MouseOverImage
=
"../Images/bk_030_delete_normal.png"
Visibility
=
"{Binding Path=DataContext.IsDeleteSupported, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}, Converter={StaticResource BooleanToVisibilityConverter}}"
ToolTip
=
"{Binding Path=DataContext.DeleteCommandToolTip, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}}"
Command
=
"{Binding Path=DataContext.DeleteCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}}"
/>
<
bc:RadGridViewActionButton
NormalImage
=
"../Images/dgy_028_copy_normal.png"
MouseOverImage
=
"../Images/bk_028_copy_normal.png"
Visibility
=
"{Binding Path=DataContext.IsCopySupported, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}, Converter={StaticResource BooleanToVisibilityConverter}}"
ToolTip
=
"{Binding Path=DataContext.CopyCommandToolTip, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}}"
Command
=
"{Binding Path=DataContext.CopyCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}}"
/>
</
StackPanel
>
</
DataTemplate
>
</
telerik:GridViewColumn.CellTemplate
>
</
telerik:GridViewColumn
>
This works well in the sense that the buttons are displayed or hidden in the grid.
But the 'Action' column with always takes into account the total width of all four buttons even when some of them are not displayed.
How can I get the GridViewColumn to only take up as much space as the actual displayed buttons?
Thanks,
Peter