Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
22468 | Dec 14,2004 08:47 AM UTC | Dec 16,2004 08:24 AM UTC | WinForms | 7 |
![]() |
Tags: GridControl |
this.gridControl1[2,4].Text = "1";
this.gridControl1[2,4].Enabled = false;
this.gridControl1[2,4].ReadOnly = true;
this.gridControl1.CutPaste.ClipboardFlags &= ~GridDragDropFlags.Styles;
If you do this, the paste will stop when it comes to a readonly cell. If you want different behavior (like skip the cell and continue with the other cells), then you would handle teh PasteCelltext event. There you would check teh target cell and set e.cancel = true if it is readonly.
private void gridControl1_PasteCellText(object sender, GridPasteCellTextEventArgs e)
{
if(e.Style.ReadOnly)
e.Cancel = true;
}
If you need to paste style information (hence cannot turn off the styles flag as above), then you will have to handle ClipboardPaste and do all the work yourself.
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.