I am able to add a row by using javascript DOM cloneNode method, Now I would like to read all the Rows of the dataGrid on the Server side.
Any Help would be appreciated
I am able to add a row by using javascript DOM cloneNode method, Now I would like to read all the Rows of the dataGrid on the Server side.
Any Help would be appreciated
Hi,
This can't be done without resorting to using hidden fields inside your form to store newly added rows. This is because the values of the rows you add to the datagrid are not posted back to the server. You need to store the row values into a hidden form field that will be posted back and you can access the values on the server side and parse it into rows and do whatever with it.
A little more insight in to what you're trying to accomplish might be helpful. Ali already mentioned one way that your code could work. You could have your code add values to hidden form fields along with adding the rows on screen. This would allow you to add rows at the browser level without requiring a post back. Of course, the downside to this is that you will still need a page refresh before your server side code can process any of the additions.
Your second option is to implement some kind of AJAX behavior on the page. This will allow your server side code to access the new row values as they are being added without requiring a total page refresh. Since you're using .NET 1.1 you can't use Microsoft's AJAX toolkit, but you could try Anthem.NET. Never tried it myself, but it's better than hand rolling your own...