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

comments and header name

Thread ID:





80741 Apr 24,2009 03:33 PM UTC May 1,2009 06:09 PM UTC WinForms 7
Tags: XlsIO
Stephane _
Asked On April 24, 2009 03:33 PM UTC


I'm using GroupingGridExcelConverterControl.GroupingGridToExcel to convert a GGC into an excel file.

-I was wondering if there was a way to easily add comment in specific cells.
-It seems like the grid is showing the mapping name for the column header instead of the column name.

Geetha M [Syncfusion]
Replied On April 27, 2009 07:49 AM UTC

Hi Stephane,

Thank you for your interest in Syncfusion products.

You can add comment to specific cell as shown in the sample located below:
My Documents\Syncfusion\EssentialStudio\\Windows\XlsIO.Windows\Samples\2.0\Data Management\Interactive Features\

Please try this and let me know if you have any questions.


Rajadurai C [Syncfusion]
Replied On April 27, 2009 11:32 AM UTC

Hi Stephane,

Thanks for your interest in Syncfusion products.

2) By default, the text set in the Name property of columndescriptor get exported to excel sheet. The text set to HeaderText property, which even display in grid cannot get exported to excel sheet. There is no direct way for exporting HeaderText set to the column with the available GroupingGridExcelConverterControl. However you can workaround this issue by setting HeaderText to the range.Text property.

Please refer to the following sample in which i used a GroupingGridExcelConverterControlExt class derived from GridExcelConverterBase class for excel export. In this class, some code in ExportColumnHeader(..) has been modified inorder to export the header text set to the column.


Stephane _
Replied On April 27, 2009 07:40 PM UTC

Rajadurai, if I understand correctly. In your sample you are creating your own GroupingGridExcelConverterControl?

If this is the case, I might be able to add Geetha solution into your sample.

Rajadurai C [Syncfusion]
Replied On April 28, 2009 01:23 PM UTC

Hi Stephane,

Thanks for your update.

Yes. It is possible to apply comments to the excel sheet cell with the provided sample. Please try the following code instead of the one handled in button1_Click event.

ExcelEngine engine = new ExcelEngine();
IApplication app = engine.Excel.Application;
IWorkbook book = app.Workbooks.Create();
book.Worksheets [0].Range["B15"].AddComment().Text = "Grid in ExcelSheet!";
GroupingGridExcelConverterControlExt gecc = new GroupingGridExcelConverterControlExt();
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.Filter = "Files(*.xls)|*.xls";
saveFileDialog.DefaultExt = ".xls";
if (saveFileDialog.ShowDialog() == DialogResult.OK)
gecc.GroupingGridToExcel(this.gridGroupingControl1, book.Worksheets[0], ConverterOptions.Default);
if (MessageBox.Show("Do you wish to open the xls file now?", "Export to Excel", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
Process proc = new Process();
proc.StartInfo.FileName = saveFileDialog.FileName;


Stephane _
Replied On April 30, 2009 03:31 PM UTC

The F80741 sample does not show the information in the SummaryRow.

Example, if I add this in the Load. I can see the beige row but its empty (in the excel file).

GridSummaryColumnDescriptor gscdHour = default(GridSummaryColumnDescriptor);
GridSummaryRowDescriptor gsrdTotal;

gsrdTotal = new GridSummaryRowDescriptor("TotalRow");
gsrdTotal.Appearance.AnyCell.BackColor = Color.Beige;
gsrdTotal.Appearance.AnyCell.HorizontalAlignment = Syncfusion.Windows.Forms.Grid.GridHorizontalAlignment.Right;
gsrdTotal.Title = "";

gscdHour = new GridSummaryColumnDescriptor("SNo", Syncfusion.Grouping.SummaryType.DoubleAggregate, "SNo", "{Sum}");


Rajadurai C [Syncfusion]
Replied On May 1, 2009 11:38 AM UTC

Hi Stephane,

In the custom class(GroupingGridExcelConverterControlExt), replace the following code in ExportSummaryRow() method

range.Text = style.FormattedText;


range.Text = column.GetDisplayText(summary.ParentGroup);

This exports the summary value in summary row to excel sheet.


Stephane _
Replied On May 1, 2009 06:09 PM UTC

Thanks! It's working.

I see it was just commented off.


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

or the page will be automatically redirected to 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