This is a migrated thread and some comments may be shown as answers.
Load On Demand - Unable To Get Value Error
1 Answer 24 Views
This is a migrated thread and some comments may be shown as answers.
Aash
Top achievements
Rank 1
Aash asked on 25 Aug 2011, 03:20 PM

Im getting the attached error with a radcombobox set up as descrubed below:

<telerik:RadComboBox ID="radComboBoxClientName" runat="server" Filter="Contains"
              Width="300px" Height="300" DataTextField="ClientAltName" DataValueField="ClientId"
              AutoPostBack="True" CausesValidation="false" EnableLoadOnDemand="True" EnableVirtualScrolling="true"
              EmptyMessage="No Client Selected" OnClientItemsRequesting="OnKPClientItemsRequesting">
              <WebServiceSettings Method="GetClients" Path="~/Services/AutoCompleteService.svc" />
          </telerik:RadComboBox>


Public Function GetClients(ByVal context As RadComboBoxContext) As RadComboBoxData
    Dim result As RadComboBoxData = New RadComboBoxData()
    Dim allClients As List(Of RadComboBoxItemData)
 
    Dim contextDictionary As IDictionary(Of String, Object) = DirectCast(context, IDictionary(Of String, Object))
    Dim deptCode As String = (DirectCast(contextDictionary("DeptCode"), String))
    Dim display As String = (DirectCast(contextDictionary("Display"), String))
 
 
    'Select Case deptCode
    'Case "EFF"
    '   From cli As Client In ClientCache.GetCacheDataTypedList
    '                  Where cli.IsValidETFMS
    '                  Select New RadComboBoxItemData With {.Text = If(display = "Short", cli.ClientShortAltName, cli.ClientAltName), .Value = CStr(cli.ClientId)}).OrderBy(Function(c) c.Text).ToList
    'Case Else
    '    allClients = (From cli As Client In ClientCache.GetCacheDataTypedList
    '                  Select New RadComboBoxItemData With {.Text = If(display = "Short", cli.ClientShortAltName, cli.ClientAltName), .Value = CStr(cli.ClientId)}).OrderBy(Function(c) c.Text).ToList
 
    'TODO : Dont like using SP, AAP.
    Dim qnClients As New List(Of DataLayer.qn_Client_getResult)
    Using kp As New DataLayer.KestrelProLinq.KestrelProDb
        qnClients = kp.qn_Client_get(deptCode).ToList()
    End Using
    allClients = (From cli As DataLayer.qn_Client_getResult In qnClients
                  Select New RadComboBoxItemData With {.Text = If(display = "Short", ClientCache.GetStoreObject.GetClientShortAltName(cli.ShortName, cli.AgressoClientId), ClientCache.GetStoreObject.GetClientAltName(cli.ShortName, cli.Name, cli.AgressoClientId)), .Value = CStr(cli.ClientId)}).OrderBy(Function(c) c.Text).ToList
    'End Select
 
 
    Dim text As String = context.Text
    If Not String.IsNullOrEmpty(text) Then
        allClients = (From item As RadComboBoxItemData In allClients
                      Where item.Text.ToLower.Contains(text.ToLower)
                      Select item).ToList
        If allClients.Count <= 1 Then allClients.Add(New RadComboBoxItemData With {.Text = "", .Value = ""})
    End If
 
    Dim numberOfItems As Integer = context.NumberOfItems
    Dim clients As List(Of RadComboBoxItemData) = allClients.Skip(numberOfItems).Take(100).ToList
 
    result.Items = clients.ToArray
 
    Dim endOffSet As Integer = numberOfItems + clients.Count
    Dim totalCount As Integer = allClients.Count
 
    If endOffSet = totalCount Then result.EndOfItems = True
 
    'If clients.Count <= 0 Then result.Message = "No Matches"
 
    Return result
End Function

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 29 Aug 2011, 03:46 PM
Hi Aash,

This problem might occur if your web service method returns an empty RadComboBoxData. If this is the case then you should try to stop the compression for the page with the RadComboBox using the following approach:
[Telerik.Web.UI.RadCompressionSettings(HttpCompression = Telerik.Web.UI.CompressionType.None)]
public partial class Default_Cs : System.Web.UI.Page
{
    ...
}


All the best,
Dimitar Terziev
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Asked by
Aash
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or