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
|