Add a column to a datagrid when user click on a button

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
ishakya
Forum Commoner
Posts: 40
Joined: Tue Jan 04, 2011 4:58 am

Add a column to a datagrid when user click on a button

Post by ishakya »

Hi all,
I need to add a column to a datagrid when user click on a button.
I can add a row to a datagrid when clicks on a button.
[text]
NAME VALUE VALUE
TSH 123
ABC 123
[/text]
When user clicks ADD Button,I need to add another column Same as a value to enter repeated values.I'm doing this to record earlier values.
I hope everyone got the idea.
Thanks all
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Add a column to a datagrid when user click on a button

Post by pickle »

Moving to the "Javascript" forum.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
EnDee321
Forum Newbie
Posts: 6
Joined: Tue Nov 01, 2011 9:19 am

Re: Add a column to a datagrid when user click on a button

Post by EnDee321 »

Hi,
You may use a dynamic grid. When you generate the grid, maintain a variable for the number of columns. When you click the button, increase the variable value and regenerate the grid.
Sorry I dnt have facilities to post a sample code as Im in office :D Hope you get what Im saying.

Regards.
Post Reply