Pre-Populate New BLB Child Object?

Pre-Populate New BLB Child Object?

Old forum URL: forums.lhotka.net/forums/t/8065.aspx


dmbRedGetta posted on Monday, November 30, 2009

I have a list of status values with an integer field that allows the user to control the order.  The implementation is almost identical to the RolesEdit example in the book, except for the additional Order field.

I'm trying to query the db for the largest Order value so I can pre-populate the new child with the next Order value.

I have the code to hit the database in the DataPortal_Create() method of the child object, and I have changed the NewItemStatus() function to call DataPortal.Create().

How do I execute this code from the UI?  Right now, I just have a GridView inside the first View, and a DetailsView inside another View.  When the user clicks the "Add New" button, I flip to the InsertView and set the DetailsView into Insert mode, but that simply returns two empty TextBoxes based on the Fields definition of the DetailsView.

dmbRedGetta replied on Tuesday, December 01, 2009

I'm still open to suggestions, but I ended up writing a simple "GetNextOrder" command similar to the Exists command example.  Then, during the "Add New" button click event in the code-behind of my webpage, I'm using that command to pre-populate the textbox in the detailsview.

Copyright (c) Marimer LLC