473,326 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Detailsview ShowInsertButton Update button... rebinding other controls

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.

Nov 1 '06 #1
1 2515
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.DetailsViewInsertEventAr gs) Handles
DetailsView1.ItemInserting
Dim Conn As SqlConnection = New
SqlConnection(ConfigurationManager.ConnectionStrin gs("DEVConnectionString").ConnectionString.ToStrin g)
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")

Nov 1 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Jim Hammond | last post by:
I am passing the whole object instead or parameters in my select and update methods. I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate an update button, and then press...
1
by: vbnetdev | last post by:
I need to customize the DetailsView New record (insert) so that it gets the maximum value of ROWID and adds 1, places that value in the textbox and makes it read only. Also, I have a field...
4
by: Kjell Arne | last post by:
Hi! I have a detailsview control in a webpart with some templated fields on. I set the ValidationGroup property to som value on these fields to distinguish from other web parts on the page....
2
by: rockdale | last post by:
Hi, I am upgrading my asp.net 1.x to asp.net 2.0. In my page I have a datagrid and a group of textbox, dropdownlist, checkbox... etc. the datagrid and the group of controls are hooked up - when...
2
by: David Lozzi | last post by:
Howdy, I have a DetailsView that when I fire the UpdateItem event, it doesn't update the data. The page reloads and the data is set back to the original. I'm using a Button to fire the...
0
by: sansie | last post by:
Hi, I have a page which is basically a details view(in inset mode) inside a datalist. The problem is I want to set the field "invoiceID" (of the detailsview) to an invoiceID coming through the...
1
by: needhelp1 | last post by:
I have gridview with a detailsview below. When I click on 'New' in brings up the DetailsView for inserting. When I click on 'Edit' in does not brink up the DetailsView. What am I doing wrong? I...
2
by: bob | last post by:
Hi, the detailsview (default mode = insert) is used to introduce names into the database. I need in code-behind the introduced name. I tried this: <asp:DetailsView ID="DetailsView1"...
5
by: =?Utf-8?B?bXBhaW5l?= | last post by:
Hello, I am completely lost as to why I can't update a DropDownList inside a DetailsView after I perform an insert into an object datasource. I tried to simply it down to the core demostration:...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.