Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

In DataGrid I Included A DataGridComboBox, and I Want To Bind That Combobox

Dynamically When An Event Is Occured In Datagrid

How It Possible?
Posted

1 solution

here the code.....put this code

VB
Dim tbl_nm As String = table_nm
           Dim ds As New DataSet
           Dim sql As String = ""
           sql = "SELECT DISTINCT " & column_nm & " FROM " & table_nm & ""
           Dim sAdapter As New OleDbDataAdapter(sql, cnn)
           cnn.Open()
           sAdapter.Fill(ds, "tbl_nm")
           combo_nm.DataSource = ds.Tables(0)
           combo_nm.DisplayMember = column_nm
           combo_nm.ValueMember = column_nm
           cnn.Close()
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900