SteveoAtilla
Regular
Hello all....
I have searched this forum and the 'net in general, and have not found a solution to my problem that works....
Here is the scenario:
I have a datagrid on an ASPX page (vb codebehind), and I need to populate a dropdown list with a static list of items. These items do not exist in the SQL backend, but there are only five of them, so it seems simple to build a static array and bind the Datagrid to that array.
Simple? Apparently not. It doesn't work.
Here is what I have tried:
I have put the code for the dropdown in the ItemDataBound event based on advice from an article I read, but am not convinced that this is the right place for it.
Any help would be greatly appreciated!!!!
Also, is an event fired when a particular dropdown list item changes?
Thanks,
Kahuna
I have searched this forum and the 'net in general, and have not found a solution to my problem that works....
Here is the scenario:
I have a datagrid on an ASPX page (vb codebehind), and I need to populate a dropdown list with a static list of items. These items do not exist in the SQL backend, but there are only five of them, so it seems simple to build a static array and bind the Datagrid to that array.
Simple? Apparently not. It doesn't work.
Here is what I have tried:
Code:
Sub dgCurrentProposal_ItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs) Handles dgCurrentProposal.ItemDataBound
If e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.Item Then
Dim drpPrice As DropDownList
drpPrice = e.Item.FindControl("dgPricingLevel")
Dim Options(5) As String
Options(0) = "Bid"
Options(1) = "Column 1"
Options(2) = "Column 2"
Options(3) = "Column 3"
Options(4) = "Column 4"
drpPrice.DataSource = Options
drpPrice.DataBind()
End If
End Sub 'Item_Bound
I have put the code for the dropdown in the ItemDataBound event based on advice from an article I read, but am not convinced that this is the right place for it.
Any help would be greatly appreciated!!!!
Also, is an event fired when a particular dropdown list item changes?
Thanks,
Kahuna