enter data for master table, hard question

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
 
O

One Handed Man \( OHM - Terry Burns \)

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))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top