I want to enable context menu on grid component when there are no rows in the grid. when rows are there we Trigger CellContextMenu="@OnCellContextMenu", but when no items in grid how can i have this enabled. also its different context menu for rows in the grid and empty space in grid
You can define EmptyTemplate with some element with context menu.
how to enable context menu when there are less number of rows and we have space left.
You can have context menu for the entire DataGrid.
I have different context menu on header and row cells
then how will i get the row(Model) reference because MouseEventArgs doesnot give us row context
As I already suggested you can use different context menus for different parts. You can get particular row only from cells context menu or you can use the entire collection from DataGrid View property.