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

Dynamically set cell datatype

1 Answer 263 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Blake
Top achievements
Rank 2
Blake asked on 01 Oct 2015, 04:24 PM

I have a batch edit grid that has a rate column, some of those rates are decimals and some are percentages. I have a column that specifies what datatype it should be. Currently, based on the object given from this command:

var grid = $("#myGrid").data("kendoGrid");
console.log(grid.dataSource.options.schema.model.fields.rate);

 The type is just a number for now. I know I can add data annotations to change that, but is there a way to do this dynamically and set individual cells to different data types? Either in Javascript or possibly a template?

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 05 Oct 2015, 08:24 AM

Hello Blake,

 

You can use the setOptions() method if you want to change options on the fly. Here is the relevant documentation:

 

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-setOptions

 

Regards,
Kiril Nikolov
Telerik
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
Tags
Grid
Asked by
Blake
Top achievements
Rank 2
Answers by
Kiril Nikolov
Telerik team
Share this question
or