Bug in DropDownList (WebForm Control) 
Author Message
 Bug in DropDownList (WebForm Control)

If there are two entries with the same value...

ddl.SelectedItem.Text always returns the text of the value which is higher
in the list....

Where can I file the bugs for MS?

Thanks

Suraj



Mon, 11 Apr 2005 06:19:25 GMT  
 Bug in DropDownList (WebForm Control)


Quote:
> If there are two entries with the same value...

> ddl.SelectedItem.Text always returns the text of the value which is higher
> in the list....

> Where can I file the bugs for MS?

Yeah, I suppose it's a bug, but...
If you have two entries with the same value, what does it matter which
one is selected?

If you really cared, you can always use:

ddl.Items[ ddl.SelectedIndex ].Text

-c



Mon, 11 Apr 2005 07:30:10 GMT  
 Bug in DropDownList (WebForm Control)
Collection in DropDownList:
    Text    Value
      A        1
      B        2
      C        1

If "C" is selected,
    ddl.SelectedItem.Text
will return "A".

What the MS Help Files say: "Gets the selected ITEM with the lowest
index in the list control". (Capitalization added).

    This is because it sees the value "1" and matches that.  The help
file would more appropriately say:  "Gets the selected VALUE with the
lowest index in the list control." since ListItem contains both Text and
Value properties.

    I call it a bug.  The concept in the Help Files is written with the
CheckBoxList control in mind which can have multiple selections and only
returns the item with the lowest index.

Chris R.


Quote:



> > If there are two entries with the same value...

> > ddl.SelectedItem.Text always returns the text of the value which is
higher
> > in the list....

> > Where can I file the bugs for MS?

> Yeah, I suppose it's a bug, but...
> If you have two entries with the same value, what does it matter which
> one is selected?

> If you really cared, you can always use:

> ddl.Items[ ddl.SelectedIndex ].Text

> -c



Mon, 11 Apr 2005 11:01:44 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. BUG in .NET C# for DropDownLists in a Table

2. WebForm to WebForm

3. Webform Controls loosing Information

4. Webform controls position

5. How to get Collection of Controls on a WebForm

6. Programatically accessing webform controls?

7. how to use window control in webform

8. Webform Image control

9. Help! Accessing Events for WebForm Controls

10. ASP.NET: adding client-side attributes to webform server control

11. Horrible user control bug stripped all user controls from my project

12. DropDownList Problem

 

 
Powered by phpBB® Forum Software