Hi,
I am having datagridview in that I have datagridview combobox column and noraml textfield. I want to know that how can I load selected value in that combox box when I am loading all entered details in data grid view.
1 Replies - 4630 Views - Last Post: 21 April 2011 - 07:07 AM
Replies To: set selected value in datagridview combobox column
#2
Re: set selected value in datagridview combobox column
Posted 21 April 2011 - 07:07 AM
I am not totally certain how you are "loading all entered details in data grid view", but if you want a quick and dirty method of shoving data into a cell that's a grid-combobox here you go! When in doubt - cast that thing!
FYI: column1 is my DataGridViewComboBoxColumn
Now you can go off and databind to that column, but that's a fairly involved process.
FYI: column1 is my DataGridViewComboBoxColumn
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
Me.DataGridView1.Rows.Add()
CType(Me.DataGridView1.Rows(0).Cells("column1"), DataGridViewComboBoxCell).Items.Add("aaa")
CType(Me.DataGridView1.Rows(0).Cells("column1"), DataGridViewComboBoxCell).Items.Add("bb")
CType(Me.DataGridView1.Rows(0).Cells("column1"), DataGridViewComboBoxCell).Items.Add("c")
End Sub
Now you can go off and databind to that column, but that's a fairly involved process.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote







|