<Window x:Class="GridViewMenuBinding.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:GridViewMenuBinding" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <Grid.DataContext>
            <local:MainViewModel/>
        </Grid.DataContext>
		<telerik:RadGridView ItemsSource="{Binding Items}" 
							 GroupRenderMode="Flat"
							 AutoGenerateColumns="False">
			<telerik:RadGridView.Columns>
				<telerik:GridViewDataColumn DataMemberBinding="{Binding Name}">
					<telerik:GridViewDataColumn.CellTemplate>
						<DataTemplate>
							<Button Content="{Binding Name}">
								<telerik:RadContextMenu.ContextMenu>
									<local:ExtendedContextMenu>
										<telerik:RadMenuItem Header="Remove Item"
															 Command="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Menu.ClickedGridViewRowItem.GridViewDataControl.DataContext.RemoveItemCmd}"
															 CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Menu.ClickedGridViewRowItem.DataContext}"/>
									</local:ExtendedContextMenu>
								</telerik:RadContextMenu.ContextMenu>
							</Button>
						</DataTemplate>
					</telerik:GridViewDataColumn.CellTemplate>
				</telerik:GridViewDataColumn>
				<telerik:GridViewDataColumn DataMemberBinding="{Binding Description}" />
			</telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</Window>
