Hi,
I have a numeric column, so only digits are allowed in the cells which come under this column.
I have restricted the characters other than digits by handling key down event.
But even if I done this it is possible to copy text to clipboard and paste into this cell using context menu or the shortcut Ctrl + V when this cell is in editing mode (insertion point inside the cell).
Regards,
Ceaser
The Grid has its own built in functionality that handles copy and paste. You may need to cancel the event. The following code snippet would execute the Process Data sub and cancel the Grid's Copy/Paste functionality.
Private Sub UltraGrid1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles UltraGrid1.KeyDown
Select Case e.KeyData
Case Keys.Control Or Keys.V
Me.ProcessData() e.Handled = True Exit Select End Select
End Sub
Magued
How about changing the column data type to int? or using a mask editor?