the value of comboBox like the dataGrid's key value
-
hello, How can I do a relation between a DataGrid and a ComboBox outside the DataGrid? I need a help in syntax, using vb.net 2003 and sql server 2000 thank you
Not a very clear question, but if you bind a bindingsource to your datagridview, you can use the alter the currently selected row by changing the .Current property of the bindingsource. I'm guessing you want to pick a row by selecting a value form your ComboBox, so you could do something like this:
Dim dgv As New DataGridView() Dim bs As New BindingSource() dgv.DataSource = bs bs.DataSource = myDataSet Dim cb As New ComboBox()
And then on SelectedIndexChange event of the combobox, you can set the bs.Current to the selected Value. -
Not a very clear question, but if you bind a bindingsource to your datagridview, you can use the alter the currently selected row by changing the .Current property of the bindingsource. I'm guessing you want to pick a row by selecting a value form your ComboBox, so you could do something like this:
Dim dgv As New DataGridView() Dim bs As New BindingSource() dgv.DataSource = bs bs.DataSource = myDataSet Dim cb As New ComboBox()
And then on SelectedIndexChange event of the combobox, you can set the bs.Current to the selected Value.10x bertburtbort but the question is that what i really need , the combobox brings its data from database. when a selected value in the comboBox then its details displayed in the dataGrid actually the data in datagrid is brought from an other table in the database that is what i need 10x again