How set dropdownlist in detailsview?

B

Bobby Edward

Pretty simple webform layout...

- Categories dropdownlist (used as a filter for gridview): ddlCategory
- Gridview
- DetailsView used ONLY for insert into the Gridview

(All of this is contained in an UpdatePanel - using Ajax)

In the InsertTemplate of the DetailsView I use a dropdown for "Category". I
want it to ALWAYS be the same as the Categories dropdownlist at the top of
the webform. So, I tried this, but it doesn't work...

Protected Sub ddlCategory_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles ddlCategory.SelectedIndexChanged
CType(dvInsert.FindControl("ddlCategoryInsert"),
DropDownList).SelectedIndex = ddlCategory.SelectedIndex
End Sub

If I debug I can see the SelectedIndex change, but it doesn't show up
properly.

Any idea why? Thanks!
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top