Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
9906 | Jan 15,2004 09:19 PM UTC | Jan 16,2004 02:23 PM UTC | WinForms | 3 |
![]() |
Tags: GridControl |
private void gridControl1_ClipboardCopy(object sender, GridCutPasteEventArgs e) { GridRangeInfo range = e.RangeList.ActiveRange; if(!range.IsEmpty) { range = range.ExpandRange(1,1, this.gridControl1.RowCount, this.gridControl1.ColCount); string s = ""; GridData data = this.gridControl1.Data; for(int row = range.Top; row <= range.Bottom; ++row) { if(!this.gridControl1.Rows.Hidden[row]) { bool firstCol = true; for(int col = range.Left; col <= range.Right; ++col) { if(!this.gridControl1.Cols.Hidden[col]) { if(!firstCol) s += "\t"; else firstCol = false; GridStyleInfo style = new GridStyleInfo(data[row, col]); s += style.Text; } } s += Environment.NewLine; } } Clipboard.SetDataObject(s); e.Handled = true; } }
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.