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

How to insert record into radgrid on the fly

4 Answers 126 Views
GridView
This is a migrated thread and some comments may be shown as answers.
kia
Top achievements
Rank 1
kia asked on 04 Jul 2011, 12:38 PM

Hi

I want to add record on fly by radgrid.

I have some textbox and two buttons (Insert and Submit) to add information in radgrid.

My senario is:   
When user enter her/his info into textbox and click on the insert button, value of textbox must be inserted into radgrid at client side without save them into database. In the final user click on the submit button, then all rows in radgrid save in database.

I see this and this demo online, but in both of them using webservice and bind grid from database.
How I can do my senario?

Thank's

4 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 06 Jul 2011, 04:33 PM
Hello Kia,

I am afraid your scenario is not a supported one as RadGrid is a data-bound control and constructs its structure according to the data that's coming from the server or a web service. 

Regards,
Tsvetoslav
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 07 Jul 2011, 04:51 PM
IMHO You can always create a client side data source (a DataTable for instance) and bind the Grid to that. There is no requirement for a DataSource to be connected to a Database or WebService Server.

PS: I'm sorry the question appears to be about the asp.net control.not the windows forms controls
0
kia
Top achievements
Rank 1
answered on 09 Jul 2011, 06:20 AM
How can I do that?
Please show me an example or document.
0
Sebastian
Telerik team
answered on 11 Jul 2011, 09:41 AM
Hi Kia,

You can see how to create a javascript array and assign it as a data source to our AJAX web grid from this help topic. With similar approach you can increase the number of items in this array based on the end user entry and rebind the grid to reflect the changes.

Kind regards,
Sebastian
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
GridView
Asked by
kia
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
erwin
Top achievements
Rank 1
Veteran
Iron
kia
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or