Ticket Q467800
Visible to All Users

How to display ButtonEdit with disabled buttons for particular cells

created 11 years ago

[DevExpress Support Team: MOVED FROM How to display disabled buttons for particular cells within a ButtonEdit column]
In my case I have a repository with 2 buttons and each button can enabled/disabled independently so if I want to cover all the cases I need 4 repositories which is not ideal.
Anything else I could do?
Thanks.

Answers approved by DevExpress Support

created 11 years ago (modified 11 years ago)

Hi,
Creating the required amount of repository items which cover all possible scenarios is the best and easiest way to achieve your goal.
Let me know if you have additional questions.

    Show previous comments (2)

      Hi,
      I'm having some problems with the update of the repository.
      When I click one of the button of the repository, some code is executed in the background. This triggers the event CustomRowCellEdit as expected. Within the event handler, I modify the repository to the right one, however the UI doesn't update. It only updates when the focus changes.
      Any idea why and how can I fix this?

      Yaroslav (DevExpress Support) 11 years ago

        Hi Carole,
        >>This triggers the event CustomRowCellEdit as expected
        The CustomRowCellEdit event is triggered only when the GridControl is being painted. Since the assigned in-place editor defines the cell appearance, this event is raised for each cell. In order to manually force GridControl repainting, utilize the GridView.RefreshRowCell/RefreshRow/RefreshDatamethods. If new editor assignment affects the currently opened cell, I suggest you save any changes made before executing any code (by using the GridView.CloseEditor method) and then re-open the same cell if necessary (by using the GridView.ShowEditor method)
        Please try this approach and let us know the results.

          I used the CloseEditor method and it worked, thanks Yaroslav.

          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.