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?
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.
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.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.