Hello
I want Only Visible true Columns Copy N Paste.
/////////////Source///////////////////
//Grid SelectionMode
this.grdItem.SelectionMode = C1.Win.C1FlexGrid.SelectionModeEnum.ListBox;
//KeyDown Event
public void set_GridCopyAndPaste(C1.Win.C1FlexGrid.C1FlexGrid oGrid, KeyEventArgs e) { if (e.Control) { switch (e.KeyCode) { case Keys.Insert: case Keys.C: // ** copy Clipboard.SetDataObject(oGrid.Clip); break; case Keys.X: // ** cut Clipboard.SetDataObject(oGrid.Clip); CellRange rg = oGrid.Selection;
rg.Data = null; break; case Keys.V: // ** paste //If C1Grid.Row > 0 And C1Grid.Col > C1Grid.Cols.Frozen And C1Grid.Cols(C1Grid.Col).AllowEditing Then
//if (oGrid.Row > 0 && oGrid.Col > oGrid.Cols.Frozen && oGrid.Cols[oGrid.Col].AllowEditing)
if (oGrid.Row > 0 && oGrid.Cols[oGrid.Col].AllowEditing) { IDataObject data = Clipboard.GetDataObject(); if (data.GetDataPresent(typeof(string))) { // get content (note: Excel appends a cr/lf) string clip = (string)data.GetData(typeof(string)); if (clip.EndsWith("\r\n")) clip = clip.Substring(0, clip.Length - 2);
oGrid.Select(oGrid.Row, oGrid.Col, oGrid.Rows.Count - 1, oGrid.Cols.Count - 1, false); oGrid.Clip = clip; oGrid.Select(oGrid.Row, oGrid.Col, false); } } break;
} } }