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
45
How can I restrict/prevents the records to be deleted from Keyboard “Delete” key
posted

 

How can I restrict/prevents the records to be deleted from Keyboard. “Delete” key.

or When i press the Delete Key from the keyboard it asking message whether the records to be Deleted with yes/No option.

how can i override the existing functionality when the user press DeleteKey .i don't want to display the message box

It is happening only in UltraGrid. It would be grate if you can help me out through your valid comments. 
 
Best Regards
R.Balaji 
Parents
No Data
Reply
  • 385
    Verified Answer
    posted

    You can do this with some simple eventhandling.

    I prefer the Grid's Keydown (ex : Ultragrid1_Keydown) event because of the many eventargs available.

     I've used this code before in my application:

    Me.Mygrid.DisplayLayout.Override.AllowDelete = DefaultableBoolean.False

    If e.KeyCode = Keys.Delete Then

    'De Nada

    Exit Sub

    End If

     You can catch any keycode you want. Use ActiveCell, ActiveRow, ActiveColumn to restrict user access if you want.

Children