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.

Unable to Export Formats in GridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

97828 Jan 12,2011 07:12 AM Nov 7,2011 10:26 AM ASP.NET Web Forms (Classic) 5
loading
Tags: GridGroupingControl
Pawan Ragde
Asked On January 12, 2011 07:12 AM

Hi,
I am using a GridGroupingControl. I have used the TableControlPrepareViewStyleInfo event to dynamically highlight values in a few columns.

I now want to export this formatting to Excel.
I am trying to use the QueryExportPreviewRowInfo event, which is a converter event.
But the problem is that this event never gets hit even after attaching the delegate.
Please help to solve this problem or suggest some new method to export dynamic formatting to excel.

Thanks.




ExportFormat_2687c400.rar

Jisha Joy [Syncfusion]
Replied On January 13, 2011 02:14 AM

Hi Pawan,

You could achieve the desired behavior by handling the QueryImportExportCellInfo event of the GridExcelConverterControl. Please refer to the code:


void converter_QueryImportExportCellInfo(object sender, Syncfusion.GridExcelConverter.GridImportExportCellInfoEventArgs e)
{
if (e.Action == Syncfusion.GridExcelConverter.GridConverterAction.Export)
{

if (e.ColIndex == 2 && e.RowIndex == 2)
{
e.ExcelCell.RichText.Text = e.GridCell.Text;
IRichTextString rtf = e.ExcelCell.RichText;

//Formatting first 4 characters
IFont greenFont = myWorkBook.CreateFont();
greenFont.RGBColor = Color.Green;
rtf.SetFont(0, 3, greenFont);

//Formatting last 4 characters
IFont blueFont = myWorkBook.CreateFont();
blueFont.RGBColor = Color.Blue;
rtf.SetFont(4, 7, blueFont);

e.Handled = true;
}


}
}

Sample for your reference:

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GCXcelExport2066192961.zip

Please let me know if this helps.

Regards,
Jisha



Pawan Ragde
Replied On January 13, 2011 05:06 AM

Hi Jisha,

Thanks for the quick reply.

Im using a Grid Grouping Control. I handled the event as you said but i am still facing the same problem, the QueryImportExportCellInfo event does not fire even after i have handled it. Are there some converter or groupinggrid settings that i have to change.

Your example works perfectly but when i integrate the same in my code the event never gets fired.

Tahnks.



FormatProblem_b324531e.rar

Pawan Ragde
Replied On January 13, 2011 05:06 AM

Hi Jisha,

Thanks for the quick reply.

Im using a Grid Grouping Control. I handled the event as you said but i am still facing the same problem, the QueryImportExportCellInfo event does not fire even after i have handled it. Are there some converter or groupinggrid settings that i have to change.

Your example works perfectly but when i integrate the same in my code the event never gets fired.

Thanks.


Jisha Joy [Syncfusion]
Replied On January 17, 2011 05:06 AM

Hi Pawan,

Please let me know the Essential Studio version you are using.

Regards,
Jisha


Pawan Ragde
Replied On November 7, 2011 10:26 AM

Hi Jisha,

I had used the GridDataBoundGrid and this issue got resolved.

But now for a different grid i need to use the GridGroupingControl and facing the same problem as above.

Im using Essential Studio Version: 8.203.0.18

P.S: As of now im not using any grouping in the GridGrouping control.


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.

;