Dynamically set cell datatype

2 posts, 0 answers
  1. Blake
    Blake avatar
    18 posts
    Member since:
    Sep 2015

    Posted 01 Oct 2015 Link to this post

    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?

  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 05 Oct 2015 Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top