Detailsview dropdownlist not updating

I get the correct display, then I click Edit, then edit some dropdownlist with SQLData Source and some textboxes.

detailsview dropdownlist not updating-89

Data Bind();" and the error goes away, but I am not able to refresh the 2nd dropdownlist (Vendor BUName).

Any suggestion to modify the code behide to bind with whatever Selected Value from Vendor Name?

I have this code my code behind to refresh the list for the dropdownlists in Details View Problem is: If I leave Selected Value= there, the dropdownlists in Edit mode seletected the correct value in the items listed when I first click Edit, but when I select a new Vendor Name, it errors "Databining method such as Eval(), Xpath(), and Bind()... Now, if I removed the Selectedvalued for the dropdownlists, it will work for refreshing the Vendor BUName when select a new Vendor Name, but NOT not selected the default Vendor ID when I click "Edit". Edit: Since binding a value to the Selected Value with Data Binder didn't work, you can try to set the value when binding data.

It just list the Vendor Name list without selected the current Vendor ID one. Provided data Source is some instance of a class that has a property called Thanks @Patrick, I get another error "System.

The dropdownlist is populated by a sqldatasource control which grabs the data from a table called Places (just a list of venues).

The detailsview is insert mode only and inserts places into the database table that populates the dropdownlist.

Private Sub Bind My Drop Down(Optional By Val selected Value as String) With my DDL . Data Value Field = "Category ID" ' or perhaps Category Name as your value. Data Source = Load Ticket Req Category(Ticket ID) . Selected Value = selected Value ' Name or ID; depends on what was set as Data Value Field End With End Sub I added some details above, I'm actually setting the data source in the web form itself.

TS_SELECTIONS WHERE (TS_FLDID = 5299 AND TS_STATUS = 0) ORDER BY TS_NAME" Dim args As New Data Source Select Arguments ddl Data Source. If you ever need to track down a defect or enhance your logic, it's the only one place to visit.

I've created a Details View that displays data based on a selected item from a Grid View.

When the Details View is under Edit Mode, it displays dropdownlists that contain data from a SQL databind.

Title = "Editing record" 'Perform dropdown list population operations Dim my DDL As Drop Down List = Details View1. Is Post Back = False Then Dim ticket_ID As String = get Data Key(Details View1) 'Fetch Category ID Dim sql Text As String = "SELECT TS_REQCATEGORY FROM USR_ITFAC WHERE (TS_ID = " ticket_ID ") " Dim req Data Reader As Sql Data Reader = Get Data Reader(sql Text) req Data Reader. Selected Value = category_Name End If End Sub My problem is that when the page loads for the first time, even though I set the selected value for the dropdownlist it will not display and instead simply displays the default first name in my dropdownlist. Edit ''Setup Drop Down List Sql Data Source ddl Data Source.

Tags: , ,