I have searched the forum but have not found a related response to the issue I am reciving.
I have a large collection of address that a user might want to add to an editor so I have created an on demand drop down list, and a button (which when clicked inserts the value into the editor)
This all works but does a full postback so I positioned the combo (both inside and outside) the ajaxPanel along with the button and the editor On clicking the button, the address is added correctly, on a subsequent search I get the Selection out of Range: Parameter Name Value.
Code behind:
The error on the server is trapped on the databind: and I have checked that rows are being correctly been returned from the following snippet.
I have a large collection of address that a user might want to add to an editor so I have created an on demand drop down list, and a button (which when clicked inserts the value into the editor)
This all works but does a full postback so I positioned the combo (both inside and outside) the ajaxPanel along with the button and the editor On clicking the button, the address is added correctly, on a subsequent search I get the Selection out of Range: Parameter Name Value.
| <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server" |
| height="75px" InitialDelayTime="500" Transparency="25" width="75px"> |
| <img alt="Loading..." |
| src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' |
| style="border:0px;" /> |
| </telerik:RadAjaxLoadingPanel><telerik:RadComboBox ID="rcmbGlobalAddress" |
| runat="server" AllowCustomText="True" CausesValidation="False" |
| EnableLoadOnDemand="True" Height="140px" ShowDropDownOnTextboxClick="False" |
| Skin="Outlook" SkinsPath="~/RadControls/ComboBox/Skins" Width="292px"> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| </telerik:RadComboBox> |
| <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" height="200px" |
| HorizontalAlign="NotSet" LoadingPanelID="RadAjaxLoadingPanel1" width="100%"> |
| <asp:Button ID="btnAddcc" runat="server" Height="25px" Text="Add CC:" /> |
| <telerik:RadEditor ID="RadEditor2" Runat="server" EditModes="Design" |
| Font-Names="Arial" Font-Size="12pt" Skin="Outlook" |
| StripFormattingOptions="MSWordRemoveAll" Width="735px"> |
| <Tools> |
| <telerik:EditorToolGroup Tag="Empty"> |
| <telerik:EditorTool Name="AboutDialog" /> |
| </telerik:EditorToolGroup> |
| </Tools> |
| <Content> |
| </Content> |
| </telerik:RadEditor> |
| </telerik:RadAjaxPanel> |
Code behind:
| Protected Sub rcmbGlobalAddress_ItemsRequested(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs) Handles rcmbGlobalAddress.ItemsRequested |
| If e.Text = String.Empty Then Exit Sub |
| Dim dl As New Datalogic |
| dtGlobalAddress = dl.getGlobalAddress(e.Text) |
| With rcmbGlobalAddress |
| .DataSource = dtGlobalAddress |
| .DataValueField = dtGlobalAddress.Columns(1).ColumnName |
| .DataTextField = dtGlobalAddress.Columns(0).ColumnName |
| .DataBind() |
| End With |
| End Sub |
| Public Function getGlobalAddress(ByVal filterval As String) As DataTable |
| _Command = New SqlCommand |
| _DataResults = New DataSet |
| With _Command |
| .CommandText = "usp_SelectGlobalAddresses" |
| .CommandType = CommandType.StoredProcedure |
| .Connection = _Connection |
| .Parameters.Add("@StartsWith", SqlDbType.VarChar, 99) |
| .Parameters("@StartsWith").Value = filterval |
| End With |
| Try |
| _Connection.Open() |
| _DataAdapter = New SqlDataAdapter(_Command) |
| _DataAdapter.Fill(_DataResults) |
| Return _DataResults.Tables(0) |
| Catch ex As Exception |
| _Error = ex.Message |
| getGlobalAddress = Nothing |
| ' Throw ex |
| Finally |
| _Connection.Close() |
| End Try |
| End Function |