I have a requirement to display the aspxgrid with the edit button, but I need to disable or hide the edit button conditionally depending upon a column's value. For example, I have a grid containing a list of transactions and their status ("Success" or "Failure"). I can only allow edits for transactions with the status of "Failure". I have tried several approaches that aren't working. Can you please point me in the right direction?
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hi,
Thank you for the report. I understand what you wish to achieve. I suggest that you use the HtmlRowCreated event, access the button element and finally set its Enabled property value to false. The sample project attached shows how this can be done in detail.
Thanks,
Plato
Hi,
With the new ASPxGridView builds, now the best solution is to handle the ASPxGridView.CommandButtonInitialize event, as illustrated in the linked example How to customize command buttons in individual rows.
Regards,
Serge