bugDotGNU Portable.NET - Bugs: bug #16733, ListBox.SelectedIndex does not...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #16733: ListBox.SelectedIndex does not accept a -1 as a value

Submitted by:  David Logan <djlogan>
Submitted on:  Fri 02 Jun 2006 12:50:39 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Tue 06 Jun 2006 06:37:29 PM UTC, comment #1:

Fixed by David Logan.

Klaus Treichel <ktreichel>
Project Administrator
Fri 02 Jun 2006 12:50:39 PM UTC, original submission:

SelectedIndex can return -1, meaning no selection. However, trying to set SelectedIndex to -1 would have caused an ArgumentOutOfRangeException, had that code been complete.

The fixed code in the SelectedIndex property code should look like this:

if(value < -1 || value >= data.Count)
throw new ArgumentOutOfRangeException(/* TODO */);

if(this.selectionMode == SelectionMode.One)
this.selectedIndices.Clear();
if(value != -1)
this.selectedIndices.Add(value);

David Logan <djlogan>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Tue 06 Jun 2006 06:37:29 PM UTCktreichelStatusNone=>Fixed
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1