Go Back   Velocity Reviews > General Computer Discussion > General Help Related Topics
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

General Help Related Topics - databound Drop Down List not changing on new selection

 
Thread Tools Search this Thread
Old 01-21-2008, 04:48 PM   #1
Default databound Drop Down List not changing on new selection


Hey everyone. I am hoping you can help..

I have a drop down list that I use a databind using a list collection,
However it populates the data I want, but when a selection is made
the change event is fired but the selected index is still the inital index

Here is the code on page load that I use that populates the dropdown. on selection of the drop down it then populates a Gridview..it works fine if you are admin, but when the selection needs to be populated by the list item it makes the selection the change event is fired but it then keeps the initial value.. any help would be appreciated as I am new to the list item thing
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
ddLOC.SelectedValue = Request.QueryString("loc")

If Not (Page.IsPostBack) Then


If Not Session("User") Is Nothing Then
emp = CType(Session("User"), Employee)

If Not emp.IsValidated Then
Response.Redirect("~/perfAppraisal.aspx", True)
End If

Else
Response.Redirect("~/perfAppraisal.aspx", True)
End If

ddLOC.DataSource = Location
ddLOC.DataTextField = "Loc_Name"
ddLOC.DataValueField = "LOC_NBR"
ddLOC.DataBind()

If Not emp.Level = Employee.PermissionLevel.Admin Then
Dim items As ListItemCollection = New ListItemCollection ' Copy to temp list

For Each item As ListItem In ddLOC.Items
If emp.Locations.Contains(item.Value) Then
items.Add(item)
End If
Next

ddLOC.Items.Clear() ' Empty DDL

For Each newItem As ListItem In items
ddLOC.Items.Add(newItem)
Next
End If
End If
End Sub

Thanks in advnce
KROSS is online now Edit/Delete Message Reply With Quote Quick reply to this message
KROSS
View Public Profile
Send a private message to KROSS
Find More Posts by KROSS
Add KROSS to Your Buddy List
Reply


KROSS
KROSS is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pass the Firefighter Selection Process tomcruise011 The Lounge 0 03-21-2009 05:23 AM
changing Crystal report table at run time rakesh201180 Software 1 10-22-2008 10:58 AM
Text Selection in IE6 with mouse A V Veerkar Software 0 11-02-2006 02:22 PM
changing recording speeds milhous451 DVD Video 3 11-16-2004 06:56 PM
Who has biggest DVD selection online? Nicolas The Great DVD Video 8 09-03-2004 06:56 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46