By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,742 Members | 2,044 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,742 IT Pros & Developers. It's quick & easy.

enter data for master table, hard question

P: n/a
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

Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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))
--
"HS1" <so*@slingshot.co.nz> wrote in message
news:1098146658.391533@ftpsrv1...
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

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.