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

Reference to unknown script element in grid

1 Answer 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stuart Watton
Top achievements
Rank 2
Stuart Watton asked on 05 Jan 2011, 12:06 PM
I have button on a page in a user control that captures the current screen html, converts it to PDF format and pops up an asp.net form that simulates a new email form with the PDF document attached allowing the user to email a screen print of the current page. This is done by rendering the page twice, once for the PDF creation and then again to rerender the page to the screen. This works fine with non ajax controls, and with ajax controls I simply need to register the script control with the RadScriptManager in the OnPreRender event.

However when I try to do this with a page that has a RadGrid on it I get an issue that I have been unable to resolve. I have enabled ContextFilterMenu oand FilteringByColumn for the grid. One of the columns in the grid is called Order_Qty with a unique name of ColOrder_Qty.

When I try to render the RadGrid For the PDF creation I get the following error:-
Script control 'RNTBF_ColOrder_Qty' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors(). Parameter name: scriptControl

So my question is, What is this RNTBF_ColOrder_Qty script control, and mores to the point how do I get a reference to it in order to be able to register it with the RadScriptManger prior to rendering?

Stuart Watton

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 10 Jan 2011, 10:32 AM
Hello Stuart,

I am not sure how this PDF rendered works, but the error seems to be due to something is trying to render IScriptControl with RenderControl.

The issue is that when you call RenderControl it forces rendering of the control without going through it's life cycle. This perfectly works for most of the controls except those that do not implements IScriptControl. IScriptControls has scripts that must be registered on PreRender which will be skipped by RenderControl and will cause such exception.

RadControls for ASP.NET AJAX expose property RegisterWithScriptManager which is true by default and setting it to false will instruct the control to not be registered as script control. This might help you in such scenarios.

All the best,
Nikolay
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Stuart Watton
Top achievements
Rank 2
Answers by
Nikolay Rusev
Telerik team
Share this question
or