Hi Far,
Yep, that's indeed a bug. (I just logged it in my on-line version of the BugBase ;) )
Fortunately, it's easy to fix. None of the data access or business logic code needs to be touched, as that all works fine. It's in the presentation layer (in the code behind of AddEditBug.aspx to be exact) where the right item in the list is not selected. Here's how to fix it:
1. Open AddEditBug.aspx.
vb from the Bugs folder.
2. Scroll down to around line number 75
3. Right below the End If of the code that sets the selected item for the lstStatus, and before the line that sets the page title, add the code in bold:
Code:
If lstStatus.Items.FindByValue(myBug.Status.Value.ToString()) IsNot Nothing Then
lstStatus.Items.FindByValue(myBug.Status.Value.ToString()).Selected = True
End If
lstPriority.ClearSelection()
If lstPriority.Items.FindByValue(myBug.Priority.ToString()) IsNot Nothing Then
lstPriority.Items.FindByValue(myBug.Priority.ToString()).Selected = True
End If
txtTitle.Text = myBug.Title
txtDescription.Text = myBug.Description
This code clears the current selection (the default Selected item of "3", set in the markup for the lstPriority control) and then sets its new selected index by looking at the Priority property of the bug.
(Sorry about the long lines; didn't want to mess with the original code by adding line breaks or underscores, to make it easier for you to see where you need to add what.)
Hope this helps,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of
ASP.NET 2.0 Instant Results and
Beginning Dreamweaver MX / MX 2004
While typing this post, I was listening to:
Avon by
Queens of the Stone Age (Track 2 from the album:
Queens of the Stone Age)
What's This?