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

modify grid column format

1 Answer 762 Views
Grid
This is a migrated thread and some comments may be shown as answers.
steven
Top achievements
Rank 1
steven asked on 27 Jul 2016, 05:57 AM

hi, i want to modify grid column format, i do it, but didn't work : 

var grid = $("#grid").data("kendoGrid");

grid.columns[1].format = "{0:C0}";

sample is here

Thank a lot 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 28 Jul 2016, 06:21 AM
Hi Steven,

You should modify the options of the Grid and pass them as parameters to the setOptions method. This will re-initialize the widget with the new options:
$('#currency').change(function () {
      var grid = $("#grid").data("kendoGrid");   
  var options = grid.options;
  options.columns[1].format = "{0:C}";
  grid.setOptions(options);
});

Hope this helps.


Regards,
Konstantin Dikov
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Grid
Asked by
steven
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or