Hi Rajagopal,
It didnt work..Pls find the code snippet below for event ClipboardPaste and also attached the screen shot pls let me know the solution
protected void grid_ClipboardPaste(object sender, Syncfusion.Windows.Forms.Grid.GridCutPasteEventArgs e)
{
CommandStack.BeginTrans(@"Paste");
// Check to see if this is a paste of new securities
if ( CurrentCell.ColIndex == (int)SecurityPricingDocument.SecurityPricingColumn.Identifier )
{
DataObject data = Clipboard.GetDataObject() as DataObject;
if ( data.GetDataPresent( DataFormats.Text ) )
{
// Determine the number of rows to be pasted
string s = data.GetData( DataFormats.Text ).ToString();
string[] rows = s.Split(new char[] { '''' } );
int numRows = rows.GetLength(0);
// Ignore blank line after the last line feed marker
if (( numRows > 0) && (rows[(numRows - 1)].Length == 0))
numRows -= 1;
// If we have valid row(s) to paste, check to see if we need to first create new empty rows
int lastRowIndex = CurrentCell.RowIndex + numRows;
if (lastRowIndex >= RowCount)
Document.AddRows(numRows);
// // For each pasted row, set the Extract checkbox
int startRowIndex = CurrentCell.RowIndex;
// for ( int rowIndex = startRowIndex; rowIndex < lastRowIndex; rowIndex++ )
// this[rowIndex, (int)SecurityPricingDocument.SecurityPricingColumn.].CellValue = true;
}
}
OnModifiedChanged(new EventArgs());
CommandStack.CommitTrans();
}
Thanks
Ravi
>Hi Ravi,
>
>By default you cant able to paste in the rowheaders. You can set ReadOnly to true for any specfic column through the code below,
>
>this.gridControl1.ColStyles[1].ReadOnly = true;
>
>If you have various cells in the grid declared as static, then you may query for the static cells in the QueryCellInfo event hander and set the ReadOnly property to true accordingly.
>
>if(e.Style.CellType == "Static")
> e.Style.ReadOnly = true;
>
>Let me know if you have any other questions.
>Thanks,
>Rajagopal
image7.zip