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

[Solved] How to Set input controls in Gridview Columns at runtime

3 Answers 142 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Senthil S
Top achievements
Rank 1
Senthil S asked on 07 Dec 2009, 12:17 PM
Hi,

I am using a gridview.I want to add input controls inside the Gridview columns at run time.

for eg:

TextBox,datePicker,CheckBox. etc.......

My another question is I want to sort the columns at code behind,,,,,,,


Regards

Senthil.S



3 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 07 Dec 2009, 03:37 PM
Hi Senthil S,

You cannot insert edit controls in RadGridView at runtime. What you can do is define CellEditTemplates for the columns and put anything you want inside. Or you can use one of the predefined columns that comes with RadGridView.

Please take a look at the Column Types and the Cell Edit Template examples.

For sorting, you should manipulate the SortDescriptors collection of RadGridView. Please, examine the Sorting example.

Consulting the online documentation is also a very good idea if you want to learn the basics of RadGridView for Silverlight. I hope this helps.

Greetings,
Ross
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
Senthil S
Top achievements
Rank 1
answered on 08 Dec 2009, 09:35 AM
Hi Ross,

Thanks for your reply.How to Create CellEditTemplate dynamically? if you have a sample project send it to me.

Regards

Senthil.S
0
Rossen Hristov
Telerik team
answered on 08 Dec 2009, 01:19 PM
Hello Senthil S,

Actually, you can create custom editors easily by following the instructions in the blog post "How to: Create custom editor with RadGridView for Silverlight and WPF".

You can decide what editor to create at runtime in the CreateCellElement method. I hope this helps.

All the best,
Ross
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.
Tags
GridView
Asked by
Senthil S
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Senthil S
Top achievements
Rank 1
Share this question
or