Calculated field

2 posts, 0 answers
  1. Dina
    Dina avatar
    50 posts
    Member since:
    Feb 2012

    Posted 07 Jan 2015 Link to this post

    Is any way to hide calculated column in edit mode?
    I have age calculated then grid read ajax data
          Age = (human.Dateofbirth > DateTime.Now.AddYears(-(DateTime.Now.Year - human.Dateofbirth.Value.Year))) ? (DateTime.Now.Year - human.Dateofbirth.Value.Year) - 1 : DateTime.Now.Year - human.Dateofbirth.Value.Year
    Column shows age in grid but also appears in pop up edit mode

    I know I can catch event and dynamically hide icon just wander if grid can aware of calculated column

    in model:
            public int Age
  2. Petur Subev
    Petur Subev avatar
    1882 posts

    Posted 09 Jan 2015 Link to this post

    Hello Dima,

    Set the Editable option for that field to false in order to make it non editable i.e. readonly

        .DataSource(dataSource => dataSource
                model =>
                    model.Id(m => m.PersonID);

    Petur Subev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top