that pulls records and displays the DataGridView
correctly. Now, I have ColumnType as
DataGridViewComboBoxColumn of the forth
column named "Username". When I click the
combo box of the DataGridview, nothing gets
displayed at all. I just don't understand it.
Below is the code.
Expand|Select|Wrap|Line Numbers
- 'Objects already initialized
- Dim QueryU As String = "select * from Users
- where username='" & frmUsers.txtUsername.Text
- & "'"
- Dim daUser As New SqlDataAdapter
- (QueryU, SQLCon)
- Dim dtUser As New DataTable
- daUser.Fill(dtUser)
- If dtUser.Rows.Count > 0 Then
- Dim c4 As New DataGridViewComboBoxColumn()
- c4.HeaderText = "Send To"
- c4.Name = "Username"
- c4.DataPropertyName =
- "Username"
- c4.DisplayMember =
- "Username"
- c4.ValueMember =
- "Username"
- c4.DisplayStyleForCurrentCellOnly = False
- c4.DisplayStyle =
- DataGridViewComboBoxDisplayStyle.Nothing
- c4.FlatStyle =
- FlatStyle.Popup
- c4.SortMode =
- DataGridViewColumnSortMode.Automatic
- c4.DataSource = dtUser
- c4.Width = 300
- frmUsers.DataGridView1.Columns.Add(c4)