---
title: "How to Use ComboBox in DataGridView Windows Application c#"  
description: "How to Use ComboBox in DataGridView Windows Application c#"  
author: "Anonymous User"  
published: 2015-12-13  
updated: 2015-12-13  
canonical: https://www.mindstick.com/forum/33722/how-to-use-combobox-in-datagridview-windows-application-c-sharp  
category: "c#"  
tags: ["c#", "windows controls", "datagridview"]  
reading_time: 2 minutes  

---

# How to Use ComboBox in DataGridView Windows Application c#

I want to use [ComboBox](https://www.mindstick.com/articles/57/display-record-according-to-combobox-selection-in-csharp-dot-net) in [DataGridView](https://www.mindstick.com/articles/607/working-with-datagridview-in-vc-sharp) [Windows](https://www.mindstick.com/articles/311752/how-to-install-and-use-the-google-wifi-software-on-a-windows-or-mac-computer) [Application c#](https://www.mindstick.com/forum/33817/how-to-use-webbrowser-controls-in-windows-forms-application-c-sharp-dot-net). please help me\

## Replies

### Reply by Anonymous User

The DataGridView control is highly configurable and extensible, and it provides many properties, methods, and events to customize its appearance and behavior. The DataGridView control makes it easy to define the basic appearance of cells and the display formatting of cell values.

Each cell within the DataGridView control can have its own style, such as text format, background color, foreground color, and font. Typically, however, multiple cells will share particular style characteristics. You can define appearance and formatting styles for individual cells, for cells in specific columns and rows, or for all cells in the control by setting the properties of the DataGridViewCellStyle objects accessed through various DataGridView control properties.

```
using System;using System.Collections.Generic;using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.IO;using System.Drawing.Imaging;using System.Data.SqlClient;using System.Data;namespace WindowsForums{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }        private void CreateColumn()        {            DataGridViewComboBoxColumn dvgcmb = new DataGridViewComboBoxColumn();            dvgcmb.HeaderText = "Product Name";            dvgcmb.Name = "productname";            dvgcmb.Items.Add("Computer");            dvgcmb.Items.Add("Mobile");            dvgcmb.Items.Add("Laptop");            dvgcmb.Items.Add("Mouse");            dvgcmb.Items.Add("Keyboard");            dataGridView1.Columns.Add("id", "ID");            dataGridView1.Columns.Add(dvgcmb);            dataGridView1.Columns.Add("quantity", "Quantity");            dataGridView1.Columns.Add("rate", "Rate");            dataGridView1.Columns.Add("amount", "Amount");        }        private void Form1_Load(object sender, System.EventArgs e)        {            CreateColumn();        }        private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)        {            int index=e.RowIndex;           decimal quantity=Convert.ToDecimal( dataGridView1.Rows[index].Cells["quantity"].Value);           decimal rate = Convert.ToDecimal(dataGridView1.Rows[index].Cells["rate"].Value);           dataGridView1.Rows[index].Cells["amount"].Value = (quantity * rate);        }                      }}
```

![How to Use ComboBox in DataGridView Windows Application c#](https://www.mindstick.com/mindstickforums/d9e25b78-c89b-4526-8f02-4bbb7f43da0e/images/609d78df-a7f3-439c-afce-bfe5b0d15675.png)


---

Original Source: https://www.mindstick.com/forum/33722/how-to-use-combobox-in-datagridview-windows-application-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
