Questions

Updating a GridView control using a DropDownList

+
0 Votes
Locked

Updating a GridView control using a DropDownList

pbasehore
I am writing an ASPX page that incorporates a dropdown list and a gridview. I want to update my gridview when my dropdownlist's selectedvaluechanged event is triggered. This is ASPX with VB, not C#. More details follow:

-> I have turned on Auto Postback on my dropdown list. Doing tests with a textbox shows that the postback is indeed posting back.

-> The SelectedValue of my dropdownlist is a parameter in the SQL statement that drives my gridview. It works on page load; it is the postback that is not working correctly.

-> I tried using a ForEach loop to do an update row for each row in the gridview, but it didn't work because the datatype "GridViewRow" is not an integer.

-> My dropdownlist is not embedded inside my gridview. So far that is the only thing I have found in my online searches, so I just wanted to make that clear.

I was thinking on trying to add something to the DropDownList.SelectedValueChanged event, but I wasn't sure what to add or what the syntax would be. I saw something online about an UpdatePanel control, but there is no such control in my toolbox (I am running VisualStudio.NET 2005). Is that something I need to try to find?

Any help would be much appreciated!