RobEmDee Posted March 28, 2003 Posted March 28, 2003 I am trying to take advantage of the Parent/Child display in the Windows DataGrid similar to the SubDataSheet in Access. My problem is I am able to set the DefaultView.AllowNew = False for the Parent table but when I set the same thing for the Child table I still get the AddNew ('*') row at the bottom of the DataGrid when the Child Data is viewed. Any suggestions? Quote
Moderators Robby Posted March 29, 2003 Moderators Posted March 29, 2003 What does the code look like? Quote Visit...Bassic Software
RobEmDee Posted March 29, 2003 Author Posted March 29, 2003 (edited) I figured it out...Here is the code I ended up with for anyone who has the same problem: Dim cm as CurrencyManager Me.DstParentChild1.Tables(0).DefaultView.AllowNew = False cm = CType(Me.BindingContext(Me.DstParentChild1.Table(0), _ Me.DstParentChild1.Relations(0).RelationName), _ CurrencyManager) CType(cm.List, DataView).AllowNew = False Me.DataGrid1.DataSource = Me.DstParentChild1.Tables(0) Not very straightforward at first blush...but makes sense after reading up on the CurrencyManager documentation. [edit]is that better?[/edit] Edited March 29, 2003 by Robby Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.