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

client side add row to Grid

3 Answers 128 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marlou
Top achievements
Rank 1
Marlou asked on 26 Jun 2012, 08:55 AM
Hi!

I'm having a pretty specific question, and I wonder if it's possible what I want. In my codebehind I have a collection of objects that I bind to my gridview. In my gridview it is possible to check/uncheck some checkboxes. On a postback I read the values from the grid back into my collection of objects. When the user clicks the save button, I save the collection of objects to the database. I know this sounds a little bit clumsy, but I can't bind my database directly to my grid. 

This all works fine. However, I also want to add a row to the grid and I want to do this client side. I have my own input form and if the user clicks 'Add', I want this row to be added to the grid, with the values that the user enered in the form. I don't want my Grid to rebind or something like that. I only want the row to be there. 

Is this possible? And how can I achieve this?
 

3 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 28 Jun 2012, 05:35 AM
Hello Marlou,

Unfortunately, this scenario is not supported.

Greetings,
Tsvetoslav
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.
0
Marlou
Top achievements
Rank 1
answered on 28 Jun 2012, 02:31 PM
Hello Tsvetoslav,

Can I use my own input form to insert a new record in the database and bind the radgrid afterwards?
0
Tsvetoslav
Telerik team
answered on 02 Jul 2012, 08:08 AM
Hello Marlou,

Certainly you can. Please, take a look at the following online example:
http://demos.telerik.com/aspnet-ajax/grid/examples/client/insertupdatedelete/defaultcs.aspx

Hope it helps.

Regards,
Tsvetoslav
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
Marlou
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Marlou
Top achievements
Rank 1
Share this question
or