Search
I feel it would be necessary to create a tutorial on how I program the ComboBox in DataGridView. So, this tutorial will guide you on how to:
- Add DataSet
- Create a master/detail form
- Add ComboBox in DataGridView
How to add a DataSet
1. Click on the Data Sources.
2. Click Add New Data Source.
Follow the data source configuration wizard. Be careful though on naming your DataSet. In my case if I add two tables like Orders and Order Details I named my DataSet as OrdersDataSet.
3. Edit the newly created DataSet and add a relationship as shown below:
Click on the OrderID field in the Orders table and change the AutoIncrement Property to True. Set the AutoIncrementSeed and AutoIncrementStep value to 1.
2. Drag the Order Details Table under the Orders Table.
How to add ComboBox in DataGridView
1. Right click DataGridView control and click Edit Columns.
2. Delete other fields and leave only Qty, ProductID, and SalesPrice.
3. Click ProductID in the selected columns section and change the column type to DataGridViewComboBoxColumn.4. Edit the Data properties of ProductID
I hope this help.
- 2891 reads
Relevant Content
- ComboBox in DataGridView
- Display Record in DataGridView Based on ComboBox Selected Value
- Export Datagridview to Excel
- Setting Text Programmatically of a Databound TextBox
- How to Add-Update-Delete Record Using MySQL
- CheckBox in DataGridView
- How to Bind Data to the Windows Forms DataGridView Control
- Windows Forms - ComboBox Control
- Extracting Noun From Text Files
- Student Form









hi
how to add datas from a table to combox ?
thanks
hi
hi while adding relationship in this i get a error that says parent key and child key are identical
Post new comment