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.

Copy & Paste Hierarchial Data

Thread ID:

Created:

Updated:

Platform:

Replies:

82093 Jun 1,2009 03:29 PM Jun 3,2009 10:47 AM Windows Forms 1
loading
Tags: GridControl
Brian R
Asked On June 1, 2009 03:29 PM

Hey there,

I have a GridGroupingControl that I am currently displaying hierarchial data in. I have multiple Departments with numerous Items under each. I want to be able to right click the grid and copy the whole grid's worth of data so that a user can then paste it into something else, like Excel.

I'm currently using a snippet of code, shown below.

GridRangeInfo range = GridRangeInfo.Cells(1, 2, TableModel.RowCount, TableModel.ColCount);
GridRangeInfoList rangeList = new GridRangeInfoList();
rangeList.Add(range);
TableModel.GroupingControl.GetTableControl("Store_Order_Details").Model.RowCount, TableModel.GroupingControl.GetTableControl("Store_Order_Details").Model.ColCount);
TableModel.CutPaste.CopyTextToClipboard(rangeList);

This works fine when the grid isn't displaying hierarchial data, but as soon as it does, the results from the Copy & Paste only include the Department level data while the Item level data is replaced by spaces.

Is it possible to achieve this and how?


TIA,

Brian R

Administrator [Syncfusion]
Replied On June 3, 2009 10:47 AM

You would have to recursively loop through each record and its child tables to get at all the data displayed in a hierarchical grid. Attached is a minimal sample that does this.



GGC_NestedTables_c5cc6854.zip

CONFIRMATION

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.

;