View Single Post
  #1 (permalink)  
Old September 11th, 2006, 06:07 AM
rit01 rit01 is offline
Friend of Wrox
 
Join Date: Oct 2005
Location: , , United Kingdom.
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
Default Clearing the Dregs from a Dropdown menu

Hi All

I have 2 dropdown menus that are databound. The second dropdown list is bound to the first dropdown menu's selectedvalue.

I have created the databinding within the code behind for various reasons and for some reason when selecting a different value from within my first menu, the second menu updates accordingly but still stores the previous items too rather than refreshing and just storing the new selected data.

When I set up the databinding using SQLDatasource controls the second list updates without storing the dregs.

Please could anyone let me know what I could be missing...
Code:
Protected Sub Menu1_SelectedIndexChanged
     (ByVal sender As Object, ByVal e As System.EventArgs)

        'database connection class/ function
        Dim Menu2Populate As New dbclass()
 
        Menu2Populate.Sproc = "strored procedure"
        Menu2Populate.CustomerID = Menu1.SelectedValue
        Menu2.DataSource = Menu2Populate.RetrieveMenu2data
        Menu2.DataBind()

    End Sub
Many thanks

Rit
__________________
Rit
www.designandonline.co.uk
INSPIRE | CREATE | DELIVER
Reply With Quote