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
805
Disable usage of CTRL X in xamDataGrid
posted

Hi All,

         Please help me circumvent this issue. How would I disable usage of CTRL X in xamdatagrid. I was using the following piece of code in the KeyDown event of the XamDataGrid. While I press CTRL X, the data gets disappeared from the cell, however the data reappears when the grid is closed and reopened. Please advice.

private

void XamDataGrid_KeyDown(object sender, KeyEventArgs e)

{

if (ModifierKeys.Control == e.KeyboardDevice.Modifiers && IsReadOnly && e.Key == Key

.X)

{

e.Handled =

true

;

return

;

}

}

Regards,

Balaji Rajendran.

Wolters Kluwer, CCH, Torrance, CA.

 

  • 54937
    Offline posted

    You could either handle the ExecutingCommand and when the e.Command is DataPresenterCommands.Cut you can set the e.Cancel to true or since it sounds like you have set the FieldLayoutSettings.AllowClipboardOperations to something that includes AllowClipboardOperations.Cut, you can just exclude that enum value from what you set on the FieldLayoutSettings.AllowClipboardOperations.