We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridControl - skip a cell while pasting

Hi,
I am using gridControl for one my projects - I have a set of columns of which some of them are readonly. When the user selects a whole row , copies the row and tries to paste into another empty row, all the data must be pasted onto the new row except the readonly cells. In short, while pasting the whole row, how can we skip pasting to readonly cells ?

Thanks for your help,
-DK


2 Replies

DH Dhivya May 17, 2011 06:29 PM UTC

Hi,

Can anyone help with this please ?

Thanks,
Dhivya



RC Rajadurai C Syncfusion Team May 24, 2011 10:31 AM UTC

Hi Dhivya,

Thanks for your interest in Syncfusion Products.

We regret for the delay caused in getting back to you.

To prevent the pasting for readonly cells, you can handle the PasteCellText event as below:

// Event Invoker
this.gridControl1.PasteCellText += new GridPasteCellTextEventHandler(gridControl1_PasteCellText);

// Method Invoked
void gridControl1_PasteCellText(object sender, GridPasteCellTextEventArgs e)
{
if (e.Style.ReadOnly)
e.Cancel = true;
}


Regards,
Rajadurai


Loader.
Live Chat Icon For mobile
Up arrow icon