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

Attribute values displayed as undefined in client template

2 Answers 21 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Aydın
Top achievements
Rank 1
Aydın asked on 17 Aug 2015, 01:30 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar Terziev
Telerik team
answered on 20 Aug 2015, 06:42 AM
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
0
Aydın
Top achievements
Rank 1
answered on 20 Aug 2015, 08:31 AM
Thanks so much Dimitar. That solves my issue.
Tags
AutoCompleteBox
Asked by
Aydın
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Aydın
Top achievements
Rank 1
Share this question
or