Hi,
Is it possible to copy a pre existing grid on the page on a button press,my requirement is that a user presses a button and a copy of the current grid is creatd on the page along side the original grid.
Is there some way I can do that.?
Jim, thanks for confirming , I will certainly try creating a grid on the server which should not be very difficult.
However I am not clear on second part, actually rendering it on the page and creating a place for it, I will be very grateful if you could provide some sample code or point in the right direction.
regards,
Avijit
Yes you can - but please don't ask me to write out an example here, as it owuld be a little long.
If you look in the API for NetAdvantage you will find that all the components have server-side classes.
To create a grid dynamically, you would instantiate HtmlGridView and then add the columns etc. as needed.
On your web page you'll need a place holder tag into which the grids can be dropped, or you'll need to rewrite the page either through a full post-back or by manipulating the DOM via Javascript.
Best,Jim
Thanks for the reply Jim, I think I was not very clear with my requirements. The fucntionality is such that a user can copy the same grid multiple no. of times as he sees fit.
Since the grid is to be added dynamically, the processing will need to be done at run time. Is it possible to do this.?
Regards,
Okay, so create a second grid and give it its own data source. On the button press, have a server-side method load the data from one grid to the other. This should be pretty easy!
Actually I am trying to create a page that will be used by the users to fill in some data and the tables will be grids instead of plain HTML tables.
I need to provide the user the functionality to create the same grid on the page if in case he needs to put in data that is similar in type but not exactly same.
I have attached a sample image, the second grid is a copy of the first grid, however the data source of the copied grid needs to be different as the new data entered will also need to seprately manipulated later.