DropDownList bug?

  • Thread starter Thread starter Martin
  • Start date Start date
M

Martin

I find this hard to believe, but it appears the DropDownList control has a
bug.

I have a page that simply uses a SqlDataSource to populate the ddl, and then
triggers a SelectedIndexChanged event.
The ddl is configured to autopostback.

Trouble is, in the SelectedIndexChanged event handler, the ddl no longer
has any items, so I can't reference the selected value or index.
EnableViewState is set to true (in the properties window), so I should have
thought it's items would have been retained.

Same technique works for a ListBox control.

Has anyone else had this problem?

Is there a patch for it??

Thanks
Martin
 
Does this also happen if you use a different data source?
Do you have anything in page_load that might clear out the dropdown?
 
In fact it only reports null items when I assign the selectedvalue to
something

This left hand side of the assignment had an error. The unfortunate side
effect was to cause the debugger to misreport the value of the RHS after
having attempted the assignment and failed with a NullException.

And I thought managed code was supposed to stop bad memory operations!!

Martin
 
Post what you are trying to do.
Patrick

Martin said:
In fact it only reports null items when I assign the selectedvalue to
something

This left hand side of the assignment had an error. The unfortunate side
effect was to cause the debugger to misreport the value of the RHS after
having attempted the assignment and failed with a NullException.

And I thought managed code was supposed to stop bad memory operations!!

Martin
 
Back
Top