I am using a User Control to edit the grid values and the uc has 3 RadComboBox items (2008 Q1). I am able to populate the first combo without a problem however when I add the code to the populate the second combo (and the third) it generates the error below:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Selection out of range
Parameter name: value
Source Error:
|
Here is the code for loading the combos...if I comment out the code to load the second combo it works fine but when it is uncommented it fails. I used the Grid Edit via User Control demo as a template for this and made sure I set the datasource = nothing for the combos after loading the data but no luck. Any thoughts?
Thanks in advance...
Kelvin
Protected Sub PriceRulesDetails_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.DataBinding
'Load Status DDL
Dim oValue As Object = DataBinder.Eval(DataItem, "Status").ToString
If oValue.Equals(DBNull.Value) Then
oValue =
""
End If
With Me.rdcmbPRStatus
.Items.Insert(0,
New RadComboBoxItem("", ""))
.Items.Insert(1,
New RadComboBoxItem("Active", "A"))
.Items.Insert(2,
New RadComboBoxItem("Inactive", "I"))
.DataBind()
End With
rdcmbPRStatus.SelectedValue = oValue.ToString
rdcmbPRStatus.DataSource =
Nothing
oValue =
Nothing
'Load Cost Multiplier DDL
oValue = DataBinder.Eval(DataItem,
"CostMultiplier").ToString
If oValue.Equals(DBNull.Value) Then
oValue =
""
End If
With Me.rdcmbPRCostMultiplier
.Items.Insert(0,
New RadComboBoxItem("", ""))
.Items.Insert(1,
New RadComboBoxItem("Program Cost", "P"))
.Items.Insert(2,
New RadComboBoxItem("Retail Cost", "R"))
End With
rdcmbPRCostMultiplier.SelectedValue = oValue.ToString
rdcmbPRCostMultiplier.DataSource =
Nothing
oValue =
Nothing
'' ''Load Reward Pricing Group DDL
' ''Me.rdcmbPRRewardPriceGroup.DataSource = LoadRewardPriceGroupsDDL()
' ''Me.rdcmbPRRewardPriceGroup.DataBind()
' ''oValue = DataBinder.Eval(DataItem, "RewardGroupID").ToString
' ''If oValue.Equals(DBNull.Value) Then
' '' oValue = ""
' ''End If
' ''rdcmbPRRewardPriceGroup.SelectedValue = oValue.ToString
' ''rdcmbPRRewardPriceGroup.DataSource = Nothing
' ''oValue = Nothing
End Sub
