Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8131313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:03:43+00:00 2026-06-06T09:03:43+00:00

I am currently trying to figure out KendoUI. I am using version 2012.1.322. I

  • 0

I am currently trying to figure out KendoUI. I am using version 2012.1.322.

I have a simple array of strings List<string> returned back to the user in a web method through an AJAX call.

["name","phone","address","zip"]

When the ListView binds the list is empty, I only get

<ul id="fileAlist" data-role="listview" class="k-widget k-listview"></ul>.

I’m pretty sure it has to do with my template being wrong. What do I have to set instead of ${Object} to get it to render like:

<ul id="fileAlist" data-role="listview" class="k-widget k-listview">
  <li>name</li>
  <li>phone</li>
  <li>address</li>
  <li>zip</li>
</ul>

Here is the current code:

 $(document).ready(function () {
     $("#fileAlist").kendoListView({
         template: "<li>${Object}</li>",
         dataSource:
             new kendo.data.DataSource({
                 transport: {
                     read: {
                         url: '@Url.Action("GetColumnNames", new {File="A"})',
                         dataType: "json",
                         type: "POST",
                         contentType: "application/json; charset=utf-8"
                     }
                 }
             })
     });
 });

C# Code (in-case you’re interested)

    [HttpGet]
    public JsonResult GetColumnNames(string file)
    {
        if (file == "A")
        {
            var columns = new List<string>()
                              {
                                  "name",
                                  "phone",
                                  "address",
                                  "zip"
                              };
        }

        return new JsonResult { Data = columns, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
    }

Some other trial and fails
Here are some of the template ideas I tried and the results that came back. Obviously they all didn’t give me the string output I wanted.

  • I tried changing the template to be template: "<li>${}</li>" and when rendered I get <li>undefined</li>
  • I tried changing the tempalte to be template: "<li>$.val()</li>" and when rendered I get <li>$.val()</li>
  • I tried changing the tempalte to be template: "<li>${}.selector</li>" and when rendered I get <li>undefined.selector</li>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T09:03:44+00:00Added an answer on June 6, 2026 at 9:03 am

    There are several configuration issues in your code. I’ve simplified the code a bit to concentrate on a working example.

    Model class:

    public class Contact
    {
        public int ContactId { get; set; }
        public string Name { get; set; }
        public string Phone { get; set; }
        public string Address { get; set; }
        public string Zip { get; set; }
    }
    

    View markup, you’ll need to play with the list layout to get the desired look:

    <ul>
        <div id="contactList" style="width: 400px;"></div>
    </ul>
    

    Note how the template mark up looks like:

    <script id="template" type="text/x-kendo-tmpl">
        <li>${ Name} ${ Phone } ${ Address } ${ Zip }</li>
    </script>
    
    <script type="text/javascript" >
        $(document).ready(function () {
            var datasource = new kendo.data.DataSource({
                transport: {
                            read: {
                              url: "@(Url.Action("GetContacts", "Home"))",
                              dataType: "json",  //switched to json instead of jsonp for this example
                              contentType: "application/json; charset=utf-8",
                              type: "GET"
                           }
               }
           });
    
           $("#contactList").kendoListView({
              dataSource: datasource,
              template: kendo.template($("#template").html())  //Link the template to the list view control
           });
       });
    

    ​

    Controller that return json:

    public ActionResult GetContacts()
    {
        List<Contact> list = new List<Contact>();
        Contact contact = new Contact() { ContactId = 0, Name = "Steve", Address = "Some Street", Phone = "1-345-345-3455", Zip = "334566" };
        list.Add(contact);
        contact = new Contact() { ContactId = 1, Name = "Jim", Address = "Another Street", Phone = "1-777-987-3889", Zip = "998754" };
        list.Add(contact);
    
        return Json(list, JsonRequestBehavior.AllowGet);
    }
    

    –EDIT–

    Here is a controller that’ll return a json string without a concrete Contact object.

    public ActionResult GetContacts()
    {
        var columns = new List<Dictionary<string, object>>() {
            new Dictionary<string,object>(){ {"Name", "Rex"}, {"Phone", "1-123-123-2342"}, {"Address", "Westwood Drive"}, {"Zip", 928347}},
            new Dictionary<string,object>(){ {"Name", "Smith"}, {"Phone", "1-333-444-5555"}, {"Address", "Allen Way"}, {"Zip", 23456}}
        };
    
        return Json(columns, JsonRequestBehavior.AllowGet);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently trying to figure out a way to have an Android application
Currently working on trying to figure out asynchronous submission in ColdFusion. I always have
I am currently trying to figure out what click event handlers have attached to
I am currently trying to figure out ways to run Lua scripts using FastCGI
I am currently trying to figure out how you can bind multiple fields in
I'm trying to figure out if I'm using the DAO pattern correctly and, more
I am currently trying to figure out how sms classes are correctly represented in
I'm currently trying to figure out how to perform manual windows authentication in our
I am currently trying to figure out how to do move semantics correctly with
I'm currently trying to figure out which implementation of JSR-311 I'm going to recommend

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.