Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
14126 | May 19,2004 12:05 AM UTC | May 19,2004 06:20 AM UTC | WinForms | 1 |
![]() |
Tags: GridControl |
private void gridControl1_PasteCellText(object sender, GridPasteCellTextEventArgs e) { if(e.Style.ReadOnly) { e.Cancel = true; //skip the paste on this one cell //e.Abort = true; //abort all further pastes } }When you copy and paste from within the grid, then default behavior is to paste GridStyleInfo objects. When this is done, there is no event fired on a cell by cell basis that would allow you to easily decide whether or not to paste ReadOnly cells. One way to get around this (if you do not want to copy/paste styles) is to turn off the styles support, and then you are back in the position of only pasting text like in the first case. And you can use PasteCellText to manage the behavior of ReadOnly cells. To turn off style copy/paste support, use code like:
this.gridControl1.Model.CutPaste.ClipboardFlags &= ~GridDragDropFlags.Styles;
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.