I have two combo boxes and a command button, basically I want to click the button to add the values to my data grid (which is bound), so that I can add as many as I like then append it to the database. How do I achieve this?
Sorry, what what members of the the datagrid are bound?
If you mean it has a datasource as a table or dataset then you just need to add rows to the table.
Dim newRow as DataRow = myTable.NewRow()
row(0) = ComboBox1.SelectedValue
row(1) = ComboBox2.SelectedValue
myTable.Rows.Add(newRow)
If you're asking something different can you clarify please.
I have two combo boxes and a command button, basically I want to click the button to add the values to my data grid (which is bound), so that I can add as many as I like then append it to the database. How do I achieve this?
Sub ButtonHandler(ClickEventArgs whatever) Handles Button.Click
Me.myDataSetInstance.MyDataTable.AddMyWhateverRow(combo1.SelectedValue, combo2.SelectedValue, "other field", "another field", 123, 456, true, false)
End Sub
No, thats exactly what I was after.
Just to add the data grid has three rowa, but the third row (an ID number for the master) is hidden is there away for passingthat value in?