Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

ContextMenu is not shown for the empty space of DockPanel in DataGridTemplateColumn.

$
0
0

Hi,

I have created DataGridTemplateColumn dynamically with a dock panel containing TextBlock left aligned and Image right aligned.

Now I need to show ContextMenu in cell right click. I did that. But contextMenu is displayed only if I click on either text or Image. If I Click on the empty middle space its not getting displayed. Below is the code I wrote to set ContextMenu for Dock Panel.

My code:

l_column.CellTemplate.VisualTree.SetValue(ContextMenu.ContextMenuProperty, l_ContextMenu);

Can someone suggest me what can be done to solve this issue.

Thanks in advance.

 

Regards,

Mohana.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>