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

Sorting Issue on Grid

1 Answer 19 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rencil Justin
Top achievements
Rank 1
Rencil Justin asked on 20 May 2020, 08:19 AM

I have a grid containing dropdown column bind to the field named ChartTypeId. It has a custom template which display the ChartTypeName. The problem, it sorts the column by ChartTypeId. How can I modify it to sort by ChartTypeName instead of ChartTypeId?

 

1.{
2.  field: "ChartTypeId",
3.  title: "Chart Type",
4.  width: "auto",
5.  template: "${ChartTypeName}",
6.  editor: ChartTypeDropDownEditor,
7.  editable: true,     
8.},

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 22 May 2020, 07:37 AM

Hello Rencil,

Normally the DropDownList should be bound to an object instead of to a number or string, as shown in the Custom Editor demo. In order to make the column sortable, slight changes are required, as demonstrated in this small Dojo example.

Let me know if that works for you. If the example does not completely match your scenario, please modify it to replicate your project with any issues you are experiencing, and I will happily assist you.

Regards,
Martin
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Grid
Asked by
Rencil Justin
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or