I've searched for a while but cannot seem to find a clear answer that works for the issue. I have a datagrid that is entirely auto generated. To this I added a context menu for right clicks when the cell is not in editable mode (see below). I would like to use the same menu when the cell is in edit mode i.e. I want to override the default context menu. I've tried various options including adding a CellEditTemplate in the code behind but this does not work because I need to reference the instance of the context menu in a non static (not sealed) context and templates only appear to want to work in a static/sealed context. What should I be doing?
Thanks
Colin
<
telerik:RadGridView
x:Name
=
"dataGridView"
Margin
=
"5,10,5,5"
AutoGenerateColumns
=
"True"
AutoGeneratingColumn
=
"DataGridView_AutoGeneratingColumn"
...other options....>
<
telerik:RadGridView.ContextMenu
>
<
ContextMenu
x:Name
=
"gridContextMenu"
>
<
MenuItem
x:Name
=
"clearCellMenuItem"
Header
=
"Clear Cell"
/>
<
MenuItem
x:Name
=
"clearRowMenuItem"
Header
=
"Clear Row"
/>
<
MenuItem
x:Name
=
"clearAllMenuItem"
Header
=
"Clear All"
/>
<
Separator
x:Name
=
"separatorMenuItem"
/>
<
MenuItem
x:Name
=
"copyMenuItem"
Command
=
"Copy"
Header
=
"_Copy"
/>
<
MenuItem
x:Name
=
"pasteMenuItem"
Command
=
"Paste"
Header
=
"_Paste"
/>
</
ContextMenu
>
</
telerik:RadGridView.ContextMenu
>
</
telerik:RadGridView
>
Thanks
Colin