We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to copy selected rows including hidden columns from Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl

Thread ID:





71413 Jan 30,2008 01:53 AM Oct 23,2009 12:28 PM Windows Forms 3
Tags: GridControl
Asked On January 30, 2008 01:53 AM

How to copy selected rows including hidden columns from Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl?

Replied On January 30, 2008 01:56 AM

We would like to copy the records to the clipboard.

SubhaSheela R [Syncfusion]
Replied On February 5, 2008 03:41 AM

Hi Katherine,

Thank you for using Syncfusion products.

You can copy the selected row to clip board including hidden cell by getting all the columns in the GridGrouping control using GridColumnDescriptor. After getting all the columns, you can get details of selected record by using GetValue method of Record class. Below is the code snippet:

private void CopySelectedRecords()
foreach (SelectedRecord selRec in this.gridGroupingControl1.Table.SelectedRecords)
for (int i = 0; i < this.gridGroupingControl1.TableDescriptor.Columns.Count; ++i)
GridColumnDescriptor vcd = this.gridGroupingControl1.TableDescriptor.Columns[i];
if (i != 0)
s += '\t';
s += selRec.Record.GetValue(vcd.Name).ToString(); }
s += Environment.NewLine;
Clipboard.SetDataObject(new DataObject(s), true);

Please refer the sample available in the link below and let me know if it helps:

http://websamples.syncfusion.com//samples/ Grouping.Windows/F71413/main.htm

Subhasheela R

Santosh U
Replied On October 23, 2009 12:28 PM

Hi Subhasheela,

I have downloaded and used your code It works well. I have modified it for visiblecolumns only.

Now my columns are of type Combo Box so I get the value instead of display text (which I am fine with).

I want to paste this same copied rows in the same grid below (where AddNewRecord is there, How can we achieve this.

Please help,
Santosh U


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.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.