enter data for master table, hard question

  • Thread starter Thread starter HS1
  • Start date Start date
H

HS1

Hello all

- I have a master and a details table presented in two datagrid
- I also have some text boxes that present the values from any record in the
master table. This also helps to enter new data for the master table.

I also have a Add button to add new data
Me.BindingContext(masterGrid.DataSource, "masterTable").AddNew()


The master and details tables work well. When I click Add new button, a new,
empty record is presented in master table. Then I can enter data in the text
boxes (or in the master table)

However, the details table still presents the old data (the old data of a
master record).

What I want is that when I click Add new record for the master table, the
detail table will be empty so that I can enter new values.

Could you please help
Thanks
 
This is not the way to do it.

Your master and details grid are bound to the underlying data, you need only
to add to the underlying table to have the data reflected in the grid
because the dataGrid will receive an event to tell it to update its disply.

so In Pseduo, soemthing like

Create DataRow
Create Columns Of Data From text Boxes
Add Row to Underlying Table
' call dataAdapter method if appropriate at this stage

HTH



--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
 
Back
Top