Detailsview ShowInsertButton Update button... rebinding other controls

J

jobs

How can I rebind other controls (like a dropdownlist) when a
Detailsview Update is hit?

Also, if there an event, I don't what to override anything the control
might already be doing.
 
J

jobs

This event apparently fires before the data is actually updated, so the
new bind of the dropdown is too early.

Protected Sub DetailsView1_ItemInserting(ByVal sender As Object, ByVal
e As System.Web.UI.WebControls.DetailsViewInsertEventArgs) Handles
DetailsView1.ItemInserting
Dim Conn As SqlConnection = New
SqlConnection(ConfigurationManager.ConnectionStrings("DEVConnectionString").ConnectionString.ToString)
Dim xSQL As String = "Select distinct nameset from replicator
order by nameset"
Dim Cmd As New SqlCommand(xSQL, Conn)
Conn.Open()
Dim myDataReader As SqlDataReader = Cmd.ExecuteReader
DropDownList1.DataSource = Nothing
DropDownList1.DataSourceID = Nothing
DropDownList1.DataSource = myDataReader
DropDownList1.DataBind()
Conn.Close()
Response.Write("this fired")
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top