View Single Post
  #4 (permalink)  
Old November 25th, 2004, 08:48 AM
badgolfer badgolfer is offline
Friend of Wrox
 
Join Date: Sep 2003
Location: Whitstable, , United Kingdom.
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,

  I assume that you have created an asp drop down list in you
  datagrid by editing the HTML properties directly ?

  If so lets say you have given this drop down list an ID of
  'mydrop'.

  In you code after you bind the datasource to your datagrid
  you can add something like this:

 dim aItem as DataGridItem
 dim aDrop as DropDownList
 dim i as integer
 For i = 0 To YourDataGrid.Items.Count - 1
            aItem = YourDataGrid.Items.Item(i)
            aDrop = aItem.FindControl("mydrop")
            aDrop.Items.Add("List item 1")
            aDrop.Items.Add("List item 2")
            aDrop.Items.Add("List item 3")
 Next

this should add the 3 list items to each drop down list control
in your datagrid.