Reloading ObjectDataSource bound objects

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a simple prototype ASP application with a business object wrapping a
data set. It contains a single data table.

On my UI I have two object data sources; the first has a bound drop down
list, with a description and key. The second has a bound details view showing
everything except for the key.

Selecting an item in the drop down list, causes the details to be shown, as
intended. When I insert a new record from the details view, I want to add it
to the drop down list and select it.

How do I do this?
 
You can have the method that inserts the new record (in your BLL) returning
the primary key of the inserted record; which you use to set the
FormView.PageIndex as I did in this demo:
http://www.webswapp.com/codesamples/aspnet20/dependentlists/default.aspx

You can then use that returned primarykey to select the item from the
dropdownlist after issuing a Dropdownlist.DataBind to refresh the list items
with the newly inserted record.
 

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

Back
Top