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

RadGrid.RenderControl()

5 Answers 283 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 18 May 2008, 07:39 PM

I have a checkout page that has a RadGrid on it to display items, cost, amount of each item etc.  When I used the native MS datagrid, I was able to use DataGrid.RenderControl()  to get the html to display an exact replica of the datagrid in an email.  For some reason this will not work with the RadGrid.

This is the code I used:

StringBuilder

sb = new StringBuilder();

StringWriter sw = new StringWriter(sb);

HtmlTextWriter htw = new HtmlTextWriter(sw);

dg.RenderControl(htw);

I get a RegisterScript() error when I use this same code with the RadGrid.  Ideas/Solutions?

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 19 May 2008, 12:15 PM
Hi Tim,

Go through the following help document link.
Column types

Princy.

0
Officialboss
Top achievements
Rank 1
answered on 27 Jun 2008, 06:52 PM
I was also looking for the same thing, render the html of the RadGrid. I was not able to find what you were referring to. Could you please point me to code that does the rendering of the RadGrid.

Thanks.
0
Sebastian
Telerik team
answered on 30 Jun 2008, 06:47 AM
Hi Howard,

Is exporting the grid content to Word/Excel/CSV or PDF and then attaching the file to an email a feasible solution for your case? See the Exporting section from the online demos of the product for more details:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Overview/DefaultCS.aspx

Basically, the RenderControl() method might work for simple controls like buttons or ASP Menu, however we do not recommend using this approach to output the grid content because this may require custom approach/workaround as discussed in these resources:

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=118285
http://www.codeproject.com/KB/aspnet/ASPNet_11_Grid.aspx

Best regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Vanishree
Top achievements
Rank 1
answered on 18 Jul 2008, 07:42 AM
We have requirement to render the datagrid contorl to HTML output. We are unable to do the same with RadGrid.

This requirement is very much essential for us.

Please let us know how to do this.

Thanks
Vanishree KS
0
Sebastian
Telerik team
answered on 18 Jul 2008, 07:45 AM
Hi Vanishree,

Have you reviewed the resources linked at the bottom of my previous post? However, keep in mind that we do not recommend them since they require some custom coding/workarounds that may not cover all possible scenarios.

Kind regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Tim
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Officialboss
Top achievements
Rank 1
Sebastian
Telerik team
Vanishree
Top achievements
Rank 1
Share this question
or