我有RadGridView
一个上下文菜单,在这个上下文菜单中我有一个按钮,我在要传递gridview本身的参数中设置命令 - 我该怎么做?
<telerik:RadGridView Height="620" HorizontalAlignment="Right" Name="radGridView2" VerticalAlignment="Top" Width="1564" ShowGroupPanel="False" RowIndicatorVisibility="Collapsed" ItemsSource="{Binding Collections}" BorderBrush="#FFD7D2D2" FontFamily="Mangal" FontSize="14" Loaded="radGridView2_Loaded" AutoGenerateColumns="False"
RowStyleSelector="{StaticResource rowStyleSelector}" GroupRenderMode="Flat" ShowColumnSortIndexes="True" CanUserFreezeColumns="False" CanUserResizeColumns="False"
DataContext="{Binding}" IsReadOnly="True" DataLoading="radGridView2_DataLoading" DataLoaded="radGridView2_DataLoaded" GroupPanelForeground="#FFF01D1D"
ShowColumnFooters="True" ShowGroupFooters="True" AutoExpandGroups="True" GridLinesVisibility="Both" Grid.Row="1" Margin="0,0,35,0" MouseDoubleClick="radGridView2_MouseDoubleClick"
ColumnWidth="52*">
<telerik:RadGridView.ContextMenu>
<ContextMenu>
<ContextMenu.Items>
<Button Command="{Binding PrintCommand}" CommandParameter="{Binding}">
<Button.Content>
<TextBlock Text="Print"/>
</Button.Content>
</Button>
</ContextMenu.Items>
</ContextMenu>
</telerik:RadGridView.ContextMenu>
</telerik:RadGridView>
使用{Binding}
as myCommandParameter
不起作用它给了我单击的行 - 该行的数据上下文 - 这是一些业务对象 - 我如何获取包含网格。