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

Add row to grid without DataSource

3 Answers 247 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brad
Top achievements
Rank 1
Brad asked on 24 Jan 2008, 09:20 PM
I would like to add a row to the grid programmatically (server-side) that is not in the datasource for the grid - or to add rows to the grid without a datasource at all. Is this possible?

Thanks

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 25 Jan 2008, 07:49 AM
Hi Brad,

The grid does not support unbound mode - you can use ArrayList for example where you can add desired values and provide this as grid DataSource.

All the best,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Spacewarp
Top achievements
Rank 1
answered on 25 Sep 2008, 06:30 PM
I'm going to try something with regards to this and that is to generate a hidden ID column that's databound to a dynamically created array.

Basically, here's the situation I'm running into.

I need to ask the user how many rows they need.

Then they say 4 or 6 or whatever, and I generate that many rows.

Any thoughts on that?
0
Vlad
Telerik team
answered on 26 Sep 2008, 06:10 AM
Hello Spacewarp,

You can generate any collection of custom objects based on the user input and set this collection as RadGrid DataSource.

Greetings,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Brad
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Spacewarp
Top achievements
Rank 1
Share this question
or