This is a migrated thread and some comments may be shown as answers.

Exporting event not firing

6 Answers 76 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Denisse Zavala
Top achievements
Rank 1
Denisse Zavala asked on 18 Sep 2009, 10:00 PM
Hello,

I am trying to export to excel, it does work, however, I need to format the columns to "Number", I used the code from the Demo:

 RadGridView1.Exporting += new EventHandler<GridViewExportEventArgs>(RadGridView1_Exporting);

  void RadGridView1_Exporting(object sender, GridViewExportEventArgs e)
        {
//Some code here
}


but the code I have on RadGridView1_Exporting never gets executed.

As an additional note, the grid I'm using to export is not defined in the .xaml file, I create it dynamically from code.

I appreciate any help.

Regards.

6 Answers, 1 is accepted

Sort by
0
Evan
Telerik team
answered on 21 Sep 2009, 06:53 PM
Hello Denisse Zavala,

Could you shed a little more light on how you are using the exporting features of RadGridView?  The Exporting event only needs to fire if you are using the ToHtml export extension method- the other formats do not require the extra ability to modify html markup, therefore exporting to CSV or ExcelML will not place you into the Exporting event.  So if you are using either of these, the exporting event will not fire. 

Can I ask what you are planning on doing with the data that you require the exporting event when exporting to either CSV or ExcelML?  If you could share some more details on what issue you need to address in this event, we will be able to help more with a resolution to that problem.

Kind regards,
Evan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Denisse Zavala
Top achievements
Rank 1
answered on 28 Sep 2009, 09:26 PM
Thanks for the reply.

I am trying to export it to ExcelML, the reason is that I need the data to be numeric, and I am getting it with no format, so when I try to perform any operation with it excel won't know what to do with it... I need to change the format of the cells manually in order to do it.

Is there any way I can parse the data if not in the Exporting event?

Thank you.
0
Vlad
Telerik team
answered on 01 Oct 2009, 03:02 PM
Hi Denisse,

We will do our best to include Exporting event for ExcelML in our next internal build in the meantime please use ToHtml() instead if this is possible in your case.

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Denisse Zavala
Top achievements
Rank 1
answered on 05 Oct 2009, 05:28 PM
Is there any other way I can format the cells, I need to perform operations in Excel without having to manually format the cells.

Thanks in advance.
0
Vlad
Telerik team
answered on 09 Oct 2009, 06:01 AM
Hi Denisse,

You can use DataFormatString property of the column to format column cells. This will be respected on export.

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Denisse Zavala
Top achievements
Rank 1
answered on 09 Oct 2009, 06:29 PM
I tried that, and it does format the string, but it still a string, I need it to be an integer, otherwise Excell can not perform operations with the data.
Tags
GridView
Asked by
Denisse Zavala
Top achievements
Rank 1
Answers by
Evan
Telerik team
Denisse Zavala
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or