How to clear all DataValidation from the worksheet?

The code below doesn't work.


_sfSpreadsheet.ActiveSheet.Clear();


1 Reply

SG Santhosh Govindasamy Syncfusion Team November 14, 2024 12:53 PM UTC

Hi crosslife,

Thank you for reaching out.

Based on the information provided, you want to remove all data validations from the worksheet. This can be accomplished by using the ExcelClearOptions.ClearDataValidations API, which allows you to clear all data validations from the worksheet.

Code Snippet:

private void btn_Click(object sender, RoutedEventArgs e)

 {

     spreadsheet.Workbook.Worksheets[0].Range.Clear(Syncfusion.XlsIO.ExcelClearOptions.ClearDataValidations);

 }

    

       



For your reference, we have attached the sample and video. Please review them.

Regards,
Santhosh.G


Attachment: SpreadSheetDemo_793bb0c0.zip

Loader.
Up arrow icon