AutoGenerate columns format

2 posts, 0 answers
  1. Robert Madrian
    Robert Madrian avatar
    168 posts
    Member since:
    Apr 2003

    Posted 05 Apr Link to this post

    Hello,

    I use the following MVC Grid with AutoGenerate columns because we use a query builder and the result are always different resultsets with different columns...

    the Problem with that solution is the Format for specific columns like date, datetime and boolean, because they are not formatted the right way

    is there a possibility to format specific columns if to use AutoGenerate columns?

     

    @(Html.Kendo().Grid<dynamic>()
          .Name("gridEQ")
          .Columns(columns => columns.AutoGenerate(true))
          .Pageable()
          .Sortable()
          .Scrollable(s => s.Height("auto"))
          .NoRecords()
          .Filterable(f => f.Enabled(false))
          .AutoBind(false)
          .DataSource(dataSource => dataSource
              .Ajax()
              .PageSize(100)
              .Read(read => read.Action("ReadAsync", "Home").Data("GetQuerySQL"))
              .Events(e => e.Error("gridError"))
          )
    )
  2. Tsvetina
    Admin
    Tsvetina avatar
    2101 posts

    Posted 06 Apr Link to this post

    Hello Robert,

    It is not possible to apply settings to auto-generated columns in the Grid. However, you could consider following the approach in this sample to replace auto-generated columns with dynamically building the Columns collection:
    Bind the Grid to DataTable

    If you want to take a quick look at the main logic of the example, check this file.

    Regards,
    Tsvetina
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top