We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Readonly

Hi, is it possible to make a row readonly?

3 Replies

DY Deivaselvan Y Syncfusion Team November 19, 2018 05:33 AM UTC

Hi Chris, 

Thanks for contacting Syncfusion support. 

You can make any specific row readonly by cancelling the CurrentCellBeginEdit event for the corresponding row. Please refer to the following code example and sample from the given location. 

Code Example:  

this.sfDataGrid.CurrentCellBeginEdit += sfDataGrid_CurrentCellBeginEdit; 

void sfDataGrid_CurrentCellBeginEdit(object sender, Syncfusion.WinForms.DataGrid.Events.CurrentCellBeginEditEventArgs e) 
{ 
    if ((e.DataRow.RowData as OrderInfo).OrderID == 10002) 
        e.Cancel = true; 
} 


Refer the below documentation for more details on cancel cell editing and disable the row selection  

Regards, 
Deivaselvan 



PH Phunction November 19, 2018 06:06 AM UTC

Thanks, is it possible to override CurrentCellBeginEdit?


DY Deivaselvan Y Syncfusion Team November 20, 2018 09:07 AM UTC

Hi Chris,  

Thanks for your update. 

SfDataGrid does not have the support to override the CurrentCellBeginEdit event. So, you could handle the CurrentCellBeginEdit event to make a specific row as a read only. So, please let us know your exact need of override the CurrentCellBeginEdit event, thereby we could analyze and provide you the possible solution on it. 

Regards, 
Deivaselvan 


Loader.
Live Chat Icon For mobile
Up arrow icon