Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Bound dropdownlist inside DetailsView control not displaying ListItem added via Insert()

Reply
Thread Tools

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

 
 
donet programmer
Guest
Posts: n/a
 
      10-25-2007
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
<asp:ListItem Value="0">blank choice</asp:ListItem> ? Jim in Arizona ASP .Net 7 11-22-2006 08:31 AM
How to represent the data in a not bound control via bound control Mario Krsnic ASP .Net 0 06-23-2006 07:38 AM
Inserting a default ListItem in DropDownList Control =?Utf-8?B?QW1pIFNjaHJlaWJlcg==?= ASP .Net 1 01-13-2006 11:49 PM
DetailsView - Changing to Insert Mode (Not By Using the Insert Button In the DetailsView Control) Feege ASP .Net Web Controls 0 12-20-2005 12:28 AM
ropdownlist listitem.value not working - returns listitem.text instead Mad Scientist Jr ASP .Net 2 06-29-2004 01:13 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57