Yes it can be done.
1) Handle the ItemDataBound event, 2) check for the condition, 3) locate the
button within the item handled by the event, 4) disable the button.
This sample
http://www.societopia.net/samples/dataGrid_5c.aspx handles the
ItemDataBound, and changes the attributes of a buttonColumn of type
LinkButton.
To disable the button you can either replace it with a simple literal
control upon DataBinding or change its onClick event to alert the user (using
JavaScript) that no action is available for this selection.
--
HTH,
Phillip Williams
http://www.societopia.net http://www.webswapp.com
"jm****@hotmail.com" wrote:
Hi,
I would like to use a buttoncolumn in my datagrid. But I don't want to
enable the click on it on all the rows. I want to enable the button
according to the data specified in another column. First of all is it
possible to do so, and if yes, how can it be done?
Thanks for your help.
JULIEN