Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to display disabled buttons for particular cells within a ButtonEdit column

$
0
0

This example demonstrates how to display a disabled button for particular cells depending upon some condition. This task can be accomplished by creating a custom button editor. Please refer to the Custom Editors article to learn more about custom editor creation.

The described solution is based on overriding the OnBeginPaint() method of a custom ViewInfo class. This method is called before drawing the editor and applies a desired button state depending upon the condition. Additionally, the RepositoryItemCustomButtonEdit.GetButtonState event is implemented. Subscribing to this event allows a customer to pass any custom condition to the editor. The GetButtonState event handler has the ButtonStateEventArgs parameter, which contains a GridCellInfo class instance as the Tag property. Necessary GridControl data can be obtained from the Tag object.


Viewing all articles
Browse latest Browse all 7205

Trending Articles