![]() |
|
|
|||||||
![]() |
General Help Related Topics - databound Drop Down List not changing on new selection |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
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 |