This is a migrated thread and some comments may be shown as answers.

RadCombox Javascript error Microsoft JScript runtime error: Unable to get value of the property 'get_count': object is null or undefined

0 Answers 58 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Kiresh
Top achievements
Rank 1
Kiresh asked on 12 Apr 2013, 05:00 AM
Hello everyone,

I'm having problem with RadCombox here is my ASPX Code and i'm binding data using WCF

<telerik:RadComboBox ID="cmb" runat="server" Width="250px" Height="200px"
  Skin="Windows7" MarkFirstMatch="true" AllowCustomText="false" OnSelectedIndexChanged="cmb_SelectedIndexChanged"
  EmptyMessage="Select a Referral" EnableLoadOnDemand="true" DropDownAutoWidth="Enabled"
  EnableAutomaticLoadOnDemand="true" ItemsPerRequest="10" ShowMoreResultsBox="true"
  EnableVirtualScrolling="true" OnClientSelectedIndexChanged="onSelectedIndexChanged"
  AutoPostBack="true">
  <WebServiceSettings Method="GetLookup" Path="../Services/CommonService.svc" />
</telerik:RadComboBox>


here is my WCF method

[OperationContract]
    public RadComboBoxData GetLookup(RadComboBoxContext context)
    {
      RadComboBoxData result = new RadComboBoxData();
      List<Lookup> lst = null;
      try
      {
        lst = Data.GetLookup();
        if (lst != null)
        {
          var alll = from rl in lst
                            orderby rl.Name
                            select new RadComboBoxItemData
                            {
                              Text = rl.Name,
                              Value = Convert.ToString(rl.Id)
                            };
 
          string text = context.Text.Trim().ToLower();
          if (!String.IsNullOrEmpty(text))
          {
            alll = alll.Where(item => item.Text.Trim().ToLower().Contains(text));
          }
 
          int numberOfItems = context.NumberOfItems;
          var ls = alll.Skip(numberOfItems).Take(10);
          result.Items = ls.ToArray();
 
          int endOffset = numberOfItems + ls.Count();
          int totalCount = alll.Count();
 
          if (endOffset == totalCount)
            result.EndOfItems = true;
          result.Message = String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>",
                                         endOffset, totalCount);
        }
      }
      catch (Exception ex)
      {
        throw ex;
      }
 
      return result;
    }


i have attached error message Image that get fired when i selecting one of list from RadComboBox

Please help me ,

No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
Kiresh
Top achievements
Rank 1
Share this question
or