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

Create controls on runtime

1 Answer 109 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Silvana
Top achievements
Rank 1
Silvana asked on 20 Jan 2009, 03:49 PM
Hi all,

I was wondering if it's possible to create controls on runtime. I want the users to be able to design their own forms, placing whatever control they want on them.
I'm able to add some Telerik controls to a toolbox but then when I try to drag and drop them I got the following error:
"Failed to create component..."

I guess this is because the machine where I'm testing my app doesn't have Telerik installed and it needs the License.
Is there any kind of license which allows me to distribute my app and get rid of the necessity of having the users to install Telerik?

Thanks in advance

Regards

Silvana

1 Answer, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 23 Jan 2009, 12:28 PM
Hello Silvana,

Thank you for writing.

Yes, RadControls can be created and added to your form in run-time  in the same way as standard controls:
private void Form1_Load(object sender, EventArgs e)  
{  
    RadTextBox tb = new RadTextBox();  
    tb.Location = new Point(25, 25);  
    tb.Text = "My text";  
    this.Controls.Add(tb);  

What you are trying to accomplish (allowing your users to design their own forms) is very interesting and at the same time can be very difficult to implement.
Also there are some things that are not clear:
1. if your users will be designing forms in run-time how is the Visual Studio Toolbox involved?
2. what will be the result of a user designing a form, i.e. how that form will be persisted so that it can be loaded when it must be shown?

You can distribute your application made with RadControls by distributing Telerik's dlls on the client machine. You can find the following KB Article useful if you are using Click Once distribution.

Do not hesitate to contact me again if you have other questions.

All the best,
Martin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Silvana
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or