How to disable button column in sfdatagrid dynamically?

I Have form like this

How to disable button in sfdatagrid? 
the column value is true / false
i want to disable the button when the column value is false.

2 Replies 1 reply marked as answer

VS Vijayarasan Sivanandham Syncfusion Team August 25, 2020 03:14 AM UTC

Hi Asep Sonjaya,

Thank you for contacting Syncfusion support.

 
Currently, we are analyzing your requirement of “How to disable button column in sfdatagrid dynamically”. We will validate and update you the details on or before August 26, 2020. 
 
We appreciate your patience until then. 
 
Regards, 
Vijayarasan S

 



VS Vijayarasan Sivanandham Syncfusion Team August 27, 2020 03:37 AM UTC

Hi Asep Sonjaya,

Thank you for your patience.

Your requirement can be achieved by using the QueryButtonCellStyle event in SfDataGrid. Please refer the below code snippet,
 
sfDataGrid.QueryButtonCellStyle += SfDataGrid_QueryButtonCellStyle;

private void SfDataGrid_QueryButtonCellStyle(object sender, Syncfusion.WinForms.DataGrid.Events.QueryButtonCellStyleEventArgs e) 
{ 
            //based on customized condition enble or disable the button dynamically 
            if ((e.Record as OrderInfo).IsShipped == false) 
                e.Button.Style.Enabled = false;           
} 
 
We hope this helps. Please let us know, if you require further assistance on this.

Regards,
Vijayarasan S

 


Marked as answer
Loader.
Up arrow icon