User-72198832 posted
I have two Drop Down Lists - One for PROJECTS and one for ACTIVITIES
Each PROJECT has a unique set of ACTIVITIES
My PROJECT data contains the following Descriptions and Values:
Dropdown List displays Descr Items and Code items are selectedValues
Descr, Code
Park Maintenance, PAR
Street Maintenance, STR
Building Mantenance, BLD
ACTIVITY Data Has Descr, Act and Proj fields
Dropdown List displays Descr Items and Act items are selectedValues - Proj field is used for filtering
Sample Data:
Descr, Act, Proj
Mowing, 1, PAR
TreeTrim,2, PAR
Sweep, 1, STR
Repair, 2, STR
Paint, 1, BLD
Windows, 2, BLD
When I select a PROJECT I want only those ACTIVITIES related to that PROJECT loaded int the ACTIVITY DropDownList.
Im using Xpath to accomplish this.
Here's code I'm Using.
Private Sub lstProject_SelectedIndexChanged(sender As Object, e As EventArgs) Handles lstProject.SelectedIndexChanged
xmlActivities.DataFile = Server.MapPath("~\data\TRIMS_Net\") & Session("Serial") & "\Activities.xml"
xmlActivities.XPath = "/Activity_List/Activity[ @Proj='" & sender.selectedvalue & "']"
lstActivity.DataBind() 'Bind to Activity List
lstActivity.Selectedindex = -1
End Sub
This works fine the 1st time I select a project - correct activities are loaded into Activity List.
Selecting a different Project causes its Activities to be appended to Existing Activities in Activity DropDown List
How do I get only currently selected Data via Xpath to be in Activity List?
Any help is appreciated.
Lee