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

Control derived from RadGrid with child controls

1 Answer 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JP
Top achievements
Rank 1
JP asked on 20 Mar 2012, 03:59 PM
Hi,

I want to create a control which is derived from RadGrid. I want to add a RadTextBox and a RadButton above the Grid and want to
implement this in the derived class.

Normally, I would create both controls in CreateChildControls and Render them at the correct location in RenderContents.
Unfortunately, I get the following error message in RenderContents when calling
radTextBox.RenderControl(writer);

Script control 'radTextBox' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().

Parameter name: scriptControl

I don't wan't to create a new userControl with my two controls and the RadGrid. Could you please tell me how I can add child controls to a control derived from RadGrid?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 23 Mar 2012, 04:48 PM
Hi,

Why not create a composite control for this scenario?  If you are going to add other script controls outside of the RadGrid this would be a more appropriate solution than inheriting the RadGrid class.

Greetings,
Tsvetina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
JP
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or