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. Image for the cookie policy date
close icon

How to copy the Grid withe Nested Tables

Hi,

I am trying to copy the Grid that has NestedTables to Excel. For some reason, the Copied grid on Excel showing blank rows in for child table data. Please see below for code that I am using to copy and paste. Please help me with this issue.

private void CopyGrid_Click(object sender, System.EventArgs e)
{
GridRangeInfoList rangeList = new GridRangeInfoList();

for (int i = 0; i < this.ggFcstExcps.Table.DisplayElements.Count; i++)
{
Element el = this.ggFcstExcps.Table.DisplayElements[i];

if (el.Kind == DisplayElementKind.NestedTable)
{
NestedTable nt = (NestedTable)el;

foreach (Element chEl in nt.ChildTable.NestedDisplayElements)
{
Record r = chEl.GetRecord();

GridRangeInfo range = GridRangeInfo.Rows(i, nt.ChildTable.NestedDisplayElements.Count);
rangeList.Add(range);

Console.WriteLine(chEl.Info);

}
i += (nt.ChildTable.NestedDisplayElements.Count - 1);
}
else
{
//GridRangeInfo range = GridRangeInfo.Cells(i, 0, i, this.ggFcstExcps.TableModel.ColCount);
GridRangeInfo range = GridRangeInfo.Row(i);
rangeList.Add(range);

Console.WriteLine(el.Info);

}

}

this.ggFcstExcps.TableModel.CutPaste.CopyTextToClipboard(rangeList);

}

1 Reply

HA haneefm Syncfusion Team May 11, 2007 10:44 PM UTC

Hi Sri,

Here is a forum thread that discuss with the simillar issue.
http://www.syncfusion.com/support/forums/message.aspx?&MessageID=37186

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon