Click here to Skip to main content
16,017,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
i need to add buttons to my grid in such a way that when a person clicks on the button,that button should get disabled and another button should get enabled in the same grid..
to elaborate...each row in my grid needs to have two buttons and the second button should be enabled when the first button is clicked and the first button should be disabled...

ne ideas??

Thanks,
Posted

1 solution

I have many ideas, but the solution depends on whether or not you want to do a postback with this. If you don't want to do a postback, I'd use jQuery to manage this in the click event handler. There are many examples showing how to do this, but here's a sample of the type of syntax you'd be looking at:
JavaScript
$('#myId').click(function() {
  $('#myOtherButton').attr('disabled','enabled');
});
[EDIT]
The OP wanted further information. In case you don't know, jquery is a javascript framework that makes developing client side functionality an absolute breeze. You need to download the jquery library from JQuery[^] and add it into your web page as an include. Then, you'd hook up to the javascript I showed above, replacing #myId and #myOtherButton with the relevant ids inside a script that is fired when your page loads. The click event is then hooked up to the button.
 
Share this answer
 
v2
Comments
Sandeep Mewara 6-Dec-10 14:02pm    
Comment from OP:
i don intend to do a postback...can u please elaborate..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900