Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
How to Suppress In-Built Context Menu???????
posted
I am working on XamDataGrid and I have bind my custom context menu to the DataRecordCellArea of DataGrid and made every cell of datagrid non-editable but still when I click string column it  works fine, but on numeric or datetime column it is returning default context menu. Below I added the code that I used for Binding Context menu to Datagrid DataRecordCellArea :<ContextMenu Name="ContextDatagridMenu" x:Key="CutCopyPaste" Loaded="ContextMenu_Opened" >        <ContextMenu.Items>          <MenuItem Header="" Name="cmnuNewPart"  Click="PartEditor_New_Click" />          <MenuItem Header="" Name="cmnuOpen"  Click="PartEditor_Open_Click" />          <MenuItem Header="" Name="cmnuRename"  Click="PartEditor_Rename_Click"/>          <MenuItem Header="" Name="cmnuDeletePart"  Click="PartEditor_Delete_Click" />          <MenuItem Header="" Name="cmnuCopy"  Click="PartEditor_Copy_Click" />          <MenuItem Header="" Name="cmnuPasteNew"  Click="PartEditor_PasteNew_Click" />          <MenuItem Header="" Name="cmnuPasteData"   Click="PartEditor_PasteData_Click" />          <MenuItem Header="" Name="cmnuProved"   Click="PartEditor_Proved_Click" IsCheckable="True" />                   <MenuItem Header="" Name="cmnuNewLabel" Click="PartEditor_NewLabel_Click"/>          <MenuItem Header="" Name="cmnuAssignLabel" Click="PartEditor_AssignLabel_Click"/>        </ContextMenu.Items>      </ContextMenu>      <Style TargetType="{x:Type igDP:DataRecordCellArea}"  >        <Setter Property="ContextMenu" Value="{StaticResource CutCopyPaste}" />      </Style>

                I can’t able to suppress the in-built(Default) Context Menu. When I right click on any numeric/date-time datatype column or recordcell, it invokes default context menu rather than using my custom menu. It is invoked only when I use string datatype for column. Please give some suggestion how to solve this problem???????????????

Parents
  • 2070
    posted

    Hi Preeti,

     

    I've just tried your scenario and can't reproduce the issue. I get the custom context menu when right clicking on both text columns as well as date time, numeric etc... columns, as long as the cell is not in edit mode. This sounds similar to an issue that was fixed a while ago. Are you using the latest hotfix? If not try with the latest hotfix and see if that resolves the issue.

     

    Sandip

Reply Children