Really struggline with how to populate a dropdownlist in a datagrid when i click the edit link:

VB Code:
  1. Sub dgrdResults_PageIndexChanged (s as Object, e as DataGridPageChangedEventArgs)
  2.     dgrdResults.CurrentPageIndex = e.NewPageIndex
  3.     BindDataGrid
  4. End Sub
  5.  
  6. Sub dgrdResults_CancelCommand(s as Object, e as DataGridCommandEventArgs)
  7.     dgrdResults.EditItemIndex = -1
  8.     BindDataGrid
  9. End Sub
  10.  
  11. Sub dgrdResults_UpdateCommand(s as Object, e as DataGridCommandEventArgs)
  12.     Dim TempList as DropDownList
  13.     Dim TempValue as String
  14.    
  15.     TempList = e.Item.FindControl("drpUnitRating")
  16.     TempValue = TempList.SelectedItem.Value
  17.    
  18.     dgrdResults.EditItemIndex = -1
  19.     BindDataGrid
  20. End Sub
  21.  
  22. Function BindRating()
  23.     'Dim colArrayList as  New ArrayList
  24.     'colArrayList.Add("5")
  25.     'colArrayList.Add("4")
  26.     'colArrayList.Add("3")
  27.     'colArrayList.Add("2")
  28.     'colArrayList.Add("1")
  29.     'drpUnitRating.DataSource = colArrayList
  30.     'drpUnitRating.DataBind()
  31. End Function
  32.  
  33. Sub dgrdResults_EditCommand(s as Object, e as DataGridCommandEventArgs)
  34.     dgrdResults.EditItemIndex = e.Item.ItemIndex
  35.     BindDataGrid
  36. End Sub
  37.  
  38. ......
  39.  
  40. <asp:DataGrid
  41.                 ID="dgrdResults"
  42.                 AllowPaging="true"
  43.                 AutoGenerateColumns="false"
  44.                 PagerStyle-Mode="NumericPages" PagerStyle-PageButtonCount="5" PagerStyle-Position="Bottom"
  45.                 PageSize="25"
  46.                 OnPageIndexChanged="dgrdResults_PageIndexChanged"
  47.                 OnEditCommand="dgrdResults_EditCommand"
  48.                 OnUpdateCommand="dgrdResults_UpdateCommand"
  49.                 OnCancelCommand="dgrdResults_CancelCommand"
  50.                 CellPadding="0"
  51.                 BorderWidth="0"
  52.                 GridLines="None" CssClass="../fmcss.css"
  53.                 runat="server" >
  54.                   <columns>
  55.                   <asp:TemplateColumn>
  56.                     <itemTemplate>
  57.                       <%# Container.DataItem("PRD_BRAND") %>&nbsp;<%# Container.DataItem("PRD_MODEL") %>&nbsp;<%# Container.DataItem("PRD_NAME") %>&nbsp;<%# Container.DataItem("PRD_CATEGORY_CD") %>
  58.                     </itemTemplate>
  59.                   </asp:TemplateColumn>
  60.                   <asp:TemplateColumn>
  61.                     <itemTemplate>
  62.                       <%# Container.DataItem("UNIT_RATING") %>
  63.                     </itemTemplate>
  64.                     <edititemtemplate>
  65.                         <asp:DropDownList ID="drpUnitRating" DataTextField='<%# Container.DataItem("UNIT_RATING") %>' DataValueField='<%# Container.DataItem("UNIT_RATING") %>' DataSource='<%# BindRating %>' runat="server"></asp:DropDownList>
  66.                     </edititemtemplate>
  67.                   </asp:TemplateColumn>
  68.                   <asp:EditCommandColumn EditText="E" UpdateText="U" CancelText="C" />
  69.                   </columns>
  70.                 </asp:DataGrid>

I can do it either by connecting to a database or by just typing in say 5 values 1-5. I will be doing it both ways once I figure out how to do this. Right now I am just trying to just do it without the connecting to a database.

Thanks in advance to any replies.