Bound dropdownlist inside DetailsView control not displaying ListItem added via Insert()

D

donet programmer

The dropdown list is created inside the EditItemTemplate of the
DetailsView control. I am binding a dropdownlist to a dataset
programatically when the user switches to the Edit mode. In the code
after the binding the dropdown to the dataset, I insert a listitem at
index 0, something like this :

MyDDL.Items.Insert(0, new ListItem("-Select-", "-1"));

When I run the code and change to Edit a record, I only see data bound
items in the dropdown. This works great if I move the dropdown outside
the DetailsView.

I know there are ways to get around this, just wondering if this is a
bug in .NET 2.0?? One would expect controls to be working the same way
whether inside or outside a DetailsView, GridView controls
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top