Attribute values displayed as undefined in client template

3 posts, 1 answers
  1. Aydın
    Aydın avatar
    2 posts
    Member since:
    Mar 2015

    Posted 17 Aug 2015 Link to this post

    Hi,

     I have an autocompletebox in my page which uses a wcf service to fetch data. And I have a client template in autocompletebox which has #=Attributes.blabla # fields. WCF service returns the correct structure of data which has Text, Value and Attributes members and Attributes has the values I set. However the client template display these Attribute fields as undefined. I couldn't find any related item in this forum. 

    Can you help me? 

    Thanks.

  2. Answer
    Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 20 Aug 2015 Link to this post

    Hello Aydın,

    When a WCF service is used, the Attributes collection is serialized as an array of Name-Value pairs, so in order to access a give attribute inside the ClientTemplate this should be done by index:

      #=Attributes[0].Value# 
      #=Attributes[1].Value# 

    Regards,
    Dimitar Terziev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Aydın
    Aydın avatar
    2 posts
    Member since:
    Mar 2015

    Posted 20 Aug 2015 in reply to Dimitar Terziev Link to this post

    Thanks so much Dimitar. That solves my issue.
Back to Top