in the usercontrol there is a list of cars with several other bits of info foe example, registration, colour etc etc, There is also an add button.
When the user clicks on the add button the dialogbox1 opens.
Dialogbox1 has several text boxes, This is to input a new car and the cars details. When they click on the add button i add this info to a database and close the form.
what i want to do is.....
Once the user clicks on the add button in the dialogbox1 is store the data to a datatable or a list and pass this back to the user control so i can append the item to the list. I think this is possible.
Other ways of doing it.
I could just repopulate the list from the database but this could cause the system to slow but i also do not know where (which event) i would put the call to repopulate the list
What i am having trouble with....
Passing the data from the dialog box1 to the usercontrol.
What i have so far ...
pretty sure that this gathers the data, now all i need to do is send this to the usercontrol on dialogbox1.close
Expand|Select|Wrap|Line Numbers
- Public Shared Function collectAppendingRow() As DataTable
- Dim tmpList As New List(Of SortData.carInfo)
- Dim tmpTbl As DataTable = Nothing
- tmpTbl.Rows.Item(0)(0) = Dialog1.MakeTextBox.Text
- tmpTbl.Rows.Item(0)(1) = Dialog1.ModelTextBox.Text
- tmpTbl.Rows.Item(0)(2) = Dialog1.ColourTextBox.Text
- tmpTbl.Rows.Item(0)(3) = Dialog1.RegTextBox.Text
- tmpTbl.Rows.Item(0)(4) = Dialog1.SpecTextBox.Text
- Return tmpTbl
- End Function