Error in sorting of list of object when using KENDO UI

0 Answers 20 Views
Filter Grid
Francis
Top achievements
Rank 1
Francis asked on 11 Apr 2024, 01:57 AM
Hello,

When I tried to filter my other columns it seems working, but for the payment type column, im getting error: At least one object must implement IComparable

Client model:
public Guid Id { get; set; }

[Display(Name = "Client Code")]
public string Ref { get; set; }

[Display(Name = "Company Name")]
public string CompanyName { get; set; }

[Display(Name = "Payment Options")]
public List<PaymentTypeViewModel> PaymentTypes { get; set; }


payment type model:
using System;

namespace Act2.Certificate.Api.Models.Client
{
    public class PaymentTypeViewModel
    {
        public Guid Id { get; set; }

        public string Name { get; set; }

        public bool Selected { get; set; }
    }
}


Controller file:
    public async Task<IActionResult> GetClientList([DataSourceRequest] DataSourceRequest request
       )
    {
        try
        {
            var list = await _mediator.Send(new ClientsQuery());
            
            DataSourceResult result = list.ToDataSourceResult(request);
            return new JsonResult(result);
        }
        catch (Exception ex)
        {
            return BadRequest(new { message = ex.Message });
        }
    }
}

Do take note, that the payment type has multiple value per row, see below image:
Francis
Top achievements
Rank 1
commented on 11 Apr 2024, 01:57 AM

Any idea or answer is appreciated. hoping for your support.
Rumen
Telerik team
commented on 11 Apr 2024, 06:44 AM | edited

Hi Francis,

From the details of your post, it seems your inquiry is closely related to using Telerik UI components within an ASP.NET MVC or ASP.NET Core suites, particularly concerning data operations with Kendo UI.

While you've posted your question in the Telerik UI for ASP.NET AJAX (Web Forms) forum, you might find more specialized assistance and resources in the Telerik forums dedicated to ASP.NET MVC or ASP.NET Core, depending on which framework you're using:

When you repost your question in the appropriate technology forum, I encourage you to provide additional details, including the name of the specific Telerik control you're using and its configuration settings. This information is crucial for allowing the community to accurately replicate your issue. Moreover, sharing insights into how you're integrating the control within your ASP.NET MVC or ASP.NET Core application, along with any relevant parts of your code (especially where the error occurs), will greatly enhance our ability to offer targeted advice and solutions. 

No answers yet. Maybe you can help?

Tags
Filter Grid
Asked by
Francis
Top achievements
Rank 1
Share this question
or