Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: 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.4K
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
0 Schatak 394
1 OriginalGriff 300
2 Abhijit Ghosh (Subho) 125
3 Andreas Gieriet 120
4 _Amy 115
0 OriginalGriff 7,137
1 Sergey Alexandrovich Kryukov 5,628
2 Maciej Los 3,529
3 Peter Leow 3,373
4 DamithSL 2,505


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 4 Jan 2013
Copyright © CodeProject, 1999-2014
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