PC Review


Reply
Thread Tools Rate Thread

Can't add item to dropdownlist in datagrid footer

 
 
Dewey
Guest
Posts: n/a
 
      28th Oct 2004
I have a datagrid with a footer that has a dropdownlist.
I am able to bind the datagrid to a dataset just fine.
But I also want to add a listitem that says "-- choose --"
to the top of the list. I am doing this in many other
places in the app, but not where the dropdownlist is in a
datagrid footer. The new item is not appearing.

The datagrid name is dlBuyingOfficeDivision and the
dropdownlist name is ddDivId. Here's the code

-------------------
Private Sub dlBuyingOfficeDivision_ItemCreated(ByVal
sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dlBuyingOfficeDivision.ItemCreated
If e.Item.ItemType = ListItemType.Footer Then

'statements to bind ddDivId to a dataset

'(this DOESN'T work here)
'add "-- choose --" to top of list
Dim myItem As New ListItem
myItem.Text = Constants.LIST_ITEM_CHOOSE
myItem.Value = ""
ddDivId.Items.Insert(0, myItem)

End If
End Sub

-------------------

Any ideas?
TIA,
Dewey

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
DataGrid Footer DropDownList OnSelectedIndexChanged Microsoft ASP .NET 0 8th Nov 2007 02:08 PM
DataGrid Footer DropDownList OnSelectedIndexChanged Microsoft C# .NET 0 8th Nov 2007 02:08 PM
Re: Datagrid footer bound dropdownlist Phil Winstanley [Microsoft MVP ASP.NET] Microsoft ASP .NET 1 16th Jun 2004 11:05 AM
Datagrid footer bound dropdownlist Mohamed Zaki Microsoft ASP .NET 1 15th Jun 2004 03:01 PM
How raise an OnSelectedIndexChanged for an DropDownList in footer of a DataGrid? Bengt-Erik Eliasson Microsoft VB .NET 0 9th Oct 2003 11:25 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:30 PM.