Hi, I have a grid in which the first column is of type checkbox and the next column is of type buttons.
What I'm trying to do is enabling the buttons when and only when the checkbox for that row is checked.
I am able to get the event for the checkbox update and check the value of it but I can't seem to find a way to diable the button for that specific row.
I just want to disbale one button individually depending on the value of the checkbox in that row.
Any help would be greatly appreciated.
I have looked in
(http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=6156)
here and there is no "actvation" property in this grid so please help.
BTW. This is a web-based.. I am not sure if that makes a difference and it's the reason that the "activation" porperty doesn't appear.
Are you trying to do this server side or client side?
client side you could use this to hide the button:
cell.getElement.style.display='none';
server side you could do something similar to this to hide the button:
grid.Rows[0].Cells[0].Style.CustomRules="display='none';"
Server side.
So hiding it is the only way? Can't disable the cell itself so the button does appear but is unsuable?
Doing this on the client side would be pretty advanced, and I don't have an example.
Here's the method I would try
1. Create a template column and put a checkbox control in the template which points to a javascript function when clicked
2. In the javascript create a method that fires when a checkbox is clicked, do the following
a. use the event object to get the checkbox that was clicked on b. use typeof(element.parentNode)=='td' to find the cell potentially looping through the parents to find the cell c. call igtbl_getCellById passing in the cell's id d. get the cell with the button from the row (off the cell object) e. find the button within the cell f. use button.disabled='disabled'; to disable the button.
This would probably be the best way to do this anyway since you are eliminating a postback just to disable a button.
Ohh wow.
Ok then, how you would go on doing it on client side?
An example would help. I gotta find a way of doing this.
Also when I try hiding the cell, all the otehr cells in the row shift left and I don't want this to happen. Any ideas on this too?
Thanks in advance for all the help.
I haven't seen a way to do it server side so if you find one let me know.
Client side you could do it by finding the input control in the cell and disable it.