Unplanned
Last Updated: 20 Jul 2020 13:38 by ADMIN
Waz
Created on: 13 Jul 2020 22:19
Category: Grid
Type: Feature Request
1
Data Annotation for Grid Aligns in Model and Column should default to right align where of integer or number

Aligning numeric values in grids is common place and best practise.  Kendo Grid does not provide any neat functionality for this, especially in MVC where the model is strongly typed. Where a MVC grid is bound to a model, the Razor Wrapper would work better if it right aligned columns if for example type int (or other numeric types which are better to be right aligned). Where this needs not to be the case a data annotation would suit.

eg.

public class MyModel
{
   [AlignRight(false)]
   public int ProductID {get; set;}

   public int Age {get; set; } // aligned right by default in Kendo Grid because of int type
}

In the above case ProductID would be left aligned, and Age would be right (which could be the default for all integer types)

With this functionality the razor implementation could also provide an align property to override align functionality.  An AutoAlign property could provide this functionalityto auto detect from model  or not (and also allow this functionality as being off to provide backwards compatibility)

@(Html.Kendo().Grid<MyModel>() .Name("grid")
.AutoAlign(false) .Columns(columns => { columns.Bound(c => c.ProductID).AlignRight(false) columns.Bound(c => c.Age).AlignRight(True) })


1 comment
ADMIN
Ivan Danchev
Posted on: 20 Jul 2020 13:38

Hello Waz,

Thank you for logging this feature request. Don't forget to vote for it, since the more votes a feature request gets, the higher its place in our priority list.

Regards,
Ivan Danchev
Progress Telerik