Create the Dropdown list in Excel using NPOI in C#

Tudip Technologies
2 min readNov 25, 2021

This Blog demonstrates how to Create the Dropdown list in Excel using NPOI in C#. Dropdown in Excel is the part of Data Validation in Excel. In the Excel sheet it is simple to select the validation region and apply the validation over the data. But in programming with C# it is not easy to Add Dropdown in Excel. We

Table of Contents

  • What is Data Validation in Excel?
  • What is NPOI and How to Add in project?
  • How to Create dropdown and add data source to dropdown?

What is Data Validation in Excel?

Excel Data Validation is a feature that allows users to control the type of data entered into your worksheet. It Means it will restrict users to enter the specific data to Excel sheet cell. Data validation allows users to only enter numeric or text values to the cell, Allow numbers, Dates and times within the specified range and other. On wrong data entered to validation it gives warning to the users to correct the data.

What is NPOI and How to Add in project?

NPIO is Free, Open Source and stand-alone implementation of POI Project of Apache for C#. NPOI is to generate the Excel report without the Microsoft office suite installed on the server. It is also used to extract the text from office documents. We can read or write Excel files using NPOI.

NuGet Package is available free on NPOI can be downloaded from the NuGet store from Here and get included in the project.

How to Create dropdown and add data source to dropdown?

In Excel we can create a dropdown in data validation and assign the data source to the dropdown of two types as follows.

  1. Manually Entered item in dropdown.
  2. Data Range from the sheet.

Read more: https://tudip.com/blog-post/create-the-dropdown-list-in-excel-using-npoi-in-c/

--

--