<asp:TemplateField HeaderText="Desc" ItemStyle-CssClass="btnDesc">
<ItemTemplate>
<asp:Button ID="btn_desc" runat="server"
Enabled="<%# ProcessDescButton() %>"
Text="<%# ProcessDescText() %>"
OnClientClick="ButtonDescAndNotesClick(this);return false;" />
</ItemTemplate>
<HeaderStyle Width="6%" HorizontalAlign="Center" />
<ItemStyle Width="6%" HorizontalAlign="Center" />
</asp:TemplateField>
This code when rendered in client does not show OnClientClick when ProcessDescButton() method returns FALSE. It only only shows OnClientClick if ProcessDescButton() it returns TRUE!
I have been through different posts regarding the same issue and replaced Enabled attribute of asp:Button to generic HTML attribute "DISABLED". That works but I need to enable and disable the button based on some logic implemented in ProcessDescButton().
I am not sure what to write to make the button enabled. Disabling works if i return "disabled"
from ProcessDescButton().