tags:

views:

6

answers:

1

Just wondering how to add a DataGrid context menu to a DataGrid? I want to be able to right click anywhere on the DataGrid. Can someone please provide a simple hello world example (just popup messagebox or something)?

Thanks!

A: 
    <DataGrid AutoGenerateColumns="False" Height="200" HorizontalAlignment="Left" Margin="97,27,0,0" Name="dataGrid1" VerticalAlignment="Top" Width="200" >
        <DataGrid.ContextMenu>
        <ContextMenu >
            <MenuItem Header="Add Divider" Click="MenuItem_Click"  />
        </ContextMenu>
        </DataGrid.ContextMenu>
    </DataGrid>
StillWorking28269