Click here to Skip to main content
12,295,482 members (57,681 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB VB.NET
I HAVE ONE TABLE in the database .
Table name is DCD
SNO RNO VALUE
1 1 A
1 2 B
1 3 C

and a datagrid view name as DB1

Sir I create a datatable rt that have rno and value .
and the dataset name is ds.


Now sir i want to fill all the values in the datagrid view combobox type coloumn withe the values of the Value Field of DCD table.


Help me regarding this
Posted 4-Jan-13 16:33pm
ankur7891.5K
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Try something like:
DataGridViewComboBoxCell cbCell = (DataGridViewComboBoxCell)myDataGrid.Rows[0].Cells[2];
cbCell.Items.Add(.....);
Refer: MSDN: DataGridViewComboBoxCell[^] and MSDN: DataGridViewComboBoxCell.Items[^] property.

Sample: Host a combo box column within a DataGridView control [^]
A short tutorial here using different approach: Binding DataGridView ComboBox Column [^]


Try out. Post specific issue if you face.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

sir

i take the values from database.
so i want to know how the datagrid view combobox type coloumn fill throgh my datatable .
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160525.2 | Last Updated 4 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100