Detailsview ShowInsertButton Update button... rebinding other controls

  • Thread starter Thread starter jobs
  • Start date Start date
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.
 
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")
 
Back
Top