.NET Excel Library - Excel data validation in C#
- Evaluate the data in the cells to ensure accuracy and data integrity.
- Text length, number, date, time, and dropdown list validations.
- Use formulas for custom data validation.
Try C# Excel Examples in Playground app.
FREE TRIALNo credit card required.
Explore ExamplesNo credit card required.
Trusted by the worldโs leading companies
.NET excel library data validation
Overview
The Syncfusion .NET Excel library (XlsIO) offers comprehensive support for data validation. It enables you to enforce predefined rules that restrict the type and format of data that users can enter into a cell.
Data Validation Code Example
This example code shows how to add dropdown list validation toan Excel worksheet using the Syncfusion .NET Excel library with just a few lines of C# code.
Key features of data validation
Discover how data validation in the Excel Library enables control over data entry, ensuring that input meets defined criteria to maintain accuracy and consistency within Excel worksheets.
Text length validation
Users can restrict the text length in a cell, ensuring data meets defined character limits and preventing errors in the worksheet.
Time validation
Restrict the entry of time values within a specified range, ensuring data accuracy when working with time-related data.
List validation
Create a dropdown list of predefined values, allowing selection from specific options to ensure consistency and reduce input errors.
Number validation
Restrict the cell input to numbers within a specified range, ensuring that only valid numerical values are entered for accurate data analysis.
Date validation
Restrict the entry of dates to within a specified range, to maintain data accuracy when dealing with date-sensitive information.
Custom validation
Define custom rules using formulas to validate data entry, providing flexibility in enforcing specific criteria that fit your needs.
Explore Data Validation References
Discover valuable resources from our blog and knowledge base articles to enhance your efficiency in using data validation.
๐ Implementing data validation in Excel cells using C#.
Blog
Implementing Data Validation in Excel Cells Using C#
๐ Create list data validation in C# and VB.NET.
Knowledge base
How to create list data validation for more than 255 characters in C# VB.NET?
๐ Set datarange for validation from another sheet in C# and VB.NET.
Knowledge base
How to set DataRange for data validation from a different sheet using C# VB.NET?
๐ Protect Excel columns based on dropdown value.
Knowledge base
How to protect Excel columns based on a drop down value from a cell?
๐ Create dependent multi select dropdowns in Excel using C#.
Knowledge base
How to create multiple dependent dropdown lists with multi-selection in an Excel document using C#
Explore these resources for comprehensive guides, knowledge base articles, insightful blogs, and ebooks.
Frequently Asked Questions
Can I set text length data validation using the Syncfusion Excel library?
Yes, you can set text length data validation using the Syncfusion Excel library. This functionality lets users to specify the length of text allowed in a cell or range of cells within an Excel workbook.
Can I add list values from specific cell ranges using the Syncfusion Excel library?
Yes. You can select any cell range within the workbook to create list validation.
Can I add an error box title in data validation?
Yes. You can customize the title of the error box dialogue in data validation.
Is it possible to set the data validation rule to use only whole numbers?
Yes. You can set the cell data validation to use only whole numbers so that it accepts only whole number values.
Can I create a dropdown using the Syncfusion Excel library?
Yes, you can use list validation to create a dropdown in the Excel document with a predefined range of values.
Can I add a tooltip message to the data validation cells using the Syncfusion Excel library?
Yes. You can provide an input message to the user as a tooltip in the Excel cells.
Is it possible to use Excel functions in the data validation formulas?
Yes. You can use any Excel function in the formula to validate the cell value.
Our Customers Love Us
Here are some of their experiences.
See Real Success Stories
Developers around the world trust Syncfusionโs Essential Studio to simplify complex projects and speed up delivery. With a vast library of UI controls, powerful SDKs, and reliable support, Essential Studio helps teams build enterprise-ready applications with confidence.
Read Our Customer StoriesIndustry
Software development
75% Cost reduction
50% Faster development
โIf somebody is looking for a great tool to work with? Yes. I would definitely recommend Syncfusion for anyone who is trying to develop something meaningful.โ
- Somnath Maji (Founder of Igniatek Consultancy)
Read StoryIndustry
Utilities (oil and gas)
Advanced, flexible features
Empowered users through robust and versatile functionality.
โSyncfusionโs tools have taken care of many things so I can focus on developing the application, instead of developing tools for the application.โ
- James Athyal (Software developer, McDaniel & Associates Consultants Ltd)
Read StoryIndustry
Software and technology
Efficient file management
Streamlined workflows with document libraries without building them from scratch.
โWe really love when the magic happens.โ
- Irvin Dominin (BUILDER WEB Development Manager at Sistemi)
Read StoryIndustry
Software and technology
โWe are Syncfusion fans because of the way Syncfusion treats the support.โ
- Dr. Howard Rybko (CEO of Synchrony Digital)
Read StoryIndustry
IT services and IT consulting
Improved performance
Large datasets handled with easy customization and quick debugging.
Highly customizable
Plug-and-play controls with quick template integration.
โI will surely recommend Syncfusion to others as a third-party control because I think itโs very easily customizable.โ
- Jayesh (Technical Team Lead, Capita)
Read StoryIndustry
Professional services
โWe definitely wanted Syncfusion to help us with our document processing functionality, and we were happy with and satisfied with Syncfusion.โ
- Arvind Naik (Engineering Lead, Vialto Partners)
Read StoryRated by users across the globe
Want to create, View, and edit Excel files in C# or VB.NET?
No credit card required.
Awards
Greatnessโitโs one thing to say you have it, but it means more when others recognize it. Syncfusionยฎ is proud to hold the following industry awards.
