Hi, I am using a RadGridView in which some of the cells might be read-only depending on the values of the data in other columns.
To simulate the read-only behavior, I use «CellBeginEdit» event has recommended in some threads of this forum.
My code looks like this:
private void radGridView_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
{
e.Cancel = !IsCellUpdatable();
}
The «IsCellUpdatable» function seen above returns true or false depending on if the cell has to be modified.
Up to that part, everything works properly.
The problem I encounter is that a user can still paste some data into the cell using the keyboard shortcut «Ctrl-V». The pasting command does not trigger the CellBeginEdit event, so the data is entered in the cell. Thus the read-only behavior can be bypassed. So, I need to prevent the pasting from somewhere else.
I have tried using the grid's KeyDown event but it is not fired. I then tried to override the grid's behavior and the ProcessKey event to catch the «Ctrl-V» command but then I do not have access to my form's «IsCellUpdatable» method (it is not static and cannot be).
Any other suggestions to trap and prevent the paste command?
Thanks for your help