Virtualization results in strange display behavior

4 posts, 1 answers
  1. Scott
    Scott avatar
    18 posts
    Member since:
    Mar 2015

    Posted 24 Sep 2015 Link to this post

    Correct data is returned from the server, and it seems to be paging correctly, but I get a big empty dropdown list. What am I doing wrong? As far as I can tell, this code matches the code from the demo. Using v.2015.2.805.545.


    public ActionResult GetCustomers([DataSourceRequest] DataSourceRequest request) {
        var customers = Context.Customers.Where(c => c.DateDeleted == null);
        var results = customers.ToDataSourceResult(request, ModelState, c => new CustomerSelectListItem(c));
        return Json(results, JsonRequestBehavior.AllowGet);
    public ActionResult CustomersValueMapper(int[] values) {
        //this method exists to get a concrete "row number" for the value(s) in question.
        //to fulfill this requirement, we're using List's FindIndex method over a collection of all customers stored in the Session
        var indices = new List<int>();
        var customers = GetAllCustomers();
        if (values != null) {
            //add all customers with indices >= 0
            indices.AddRange(values.Select(value => customers.FindIndex(c => c.Id == value))
                .Where(index => index >= 0));
        return Json(indices, JsonRequestBehavior.AllowGet);
    private List<Customer> GetAllCustomers() {
        if (Session["allCustomers"] == null) {
            Session["allCustomers"] = Context.Customers.Where(e => e.DateDeleted == null).ToList();
        return (List<Customer>)Session["allCustomers"];




    function valueMapper(options) {
        console.log("valueMapper: options.value = " + options.value);
            url: "@Url.Action("CustomersValueMapper", "Equipment", new {area="Dispatch"})",
            data: convertValues(options.value),
            success: function (data) {
    function convertValues(value) {           
        var data = {};
        value = $.isArray(value) ? value : [value];
        for (var idx = 0; idx < value.length; idx++) {
            data["values[" + idx + "]"] = value[idx];
        return data;



        .DataSource(ds => ds.Custom()
            .Type("aspnetmvc-ajax") //uses DataSourceRequest
            .Transport(transport => transport.Read("GetCustomers", "Equipment", new { area = "Dispatch" }))
            .Schema(schema => schema
        ).Virtual(v => v.ItemHeight(26).ValueMapper("valueMapper"))
  2. Scott
    Scott avatar
    18 posts
    Member since:
    Mar 2015

    Posted 24 Sep 2015 Link to this post

    It seems the items are there, they're just not displayed in the dropdown (see attached screenshot).


  3. Answer
    Georgi Krustev
    Georgi Krustev avatar
    3725 posts

    Posted 28 Sep 2015 Link to this post

    Hello Scott,

    The widget setup and the server implementation look correct. I am afraid that we will not be able to determine the source of the issue without reviewing a runnable demo. Would it be possible to send us such? Thus we will investigate the issue further and will be able to pinpoint the cause of the problem faster.

    Georgi Krustev
    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
  4. Scott
    Scott avatar
    18 posts
    Member since:
    Mar 2015

    Posted 29 Sep 2015 Link to this post

    My small demo project worked fine, so I tried disabling things one-by-one in my real project. It turned out to be some bad custom CSS. Thanks for the confirmation that my code was fine.
Back to Top