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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Copy & Paste Hierarchial Data

Thread ID:





82093 Jun 1,2009 07:29 PM UTC Jun 3,2009 02:47 PM UTC WinForms 1
Tags: GridControl
Brian R
Asked On June 1, 2009 07:29 PM UTC

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();
TableModel.GroupingControl.GetTableControl("Store_Order_Details").Model.RowCount, TableModel.GroupingControl.GetTableControl("Store_Order_Details").Model.ColCount);

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?


Brian R

Administrator [Syncfusion]
Replied On June 3, 2009 02:47 PM UTC

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.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon