I want to add record on fly by radgrid at client side.
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 a new row of radgrid at client side without save them into database or postback
. In the final user click on the submit button, then all rows in radgrid save in database.
I see this
demo online, but in both of them using webservice and bind grid from database.
How I can do my senario?
Teleric has forums. However, at the core, it makes more sense to make webservice/AJAX calls, even if you store them to a temp location and then store in your DB at the end. It's hard to create values dynamically and then read them on postback, much easier to send them with AJAX.
I got a solution for this. After much research I found a way that helps to acheive the desired functionatlity.
Use a AJAX modal popup on click of "Add New Row". In the popup display all the fields on click of "Add" in popup close the popup write a button click event write a logic to add a new row to the radgrid and rebind the grid. For the newly added rows use the ID column with -1.
In the next addition of rows use the incremental -1 for all the added rows. Finally you can push all the newly added rows into the DB.
All of this is done inside ajax panel, so I didnt see any delay in row additions.
26 Nov '12 - 20:24
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)