Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to add more than 1 child to a NEW parent
Message
 
To
07/09/2004 12:41:32
Max Fillmore
Essential Skills, Inc.
Lenexa, Kansas, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00938881
Message ID:
00940314
Views:
21
Max,

>Any thoughts on this one?

First of all, I noticed the Order Detail DataGrid is set to allow entering new records by pressing the down arrow. I've recently changed this (by setting the grid's AddRowsWithDownArrow property to false) because it's best not to add new rows outside the context of a business object.

Also, try changing the code in the btnNewDetail button to the following (you can simply remove the second, btnNewItem button):
Private Sub btnNewDetail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNewDetail.Click
    Me.oOrderDetail.NewRow(New OrderDetailDefaultValues(Integer.Parse(Me.txtOrderID.Text)))
    Me.grdOrderDetail.NavigateData(mmNavigate.Last)
    Me.grdOrderDetail.Focus()
End Sub
Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform