Tag Helper on Grid with Local Datasource

4 posts, 0 answers
  1. Usep
    Usep avatar
    1 posts
    Member since:
    May 2014

    Posted 18 May 2018 Link to this post

    Hi There ...

    How to use tag helper on Grid with Local datasource

    @model PromiseOnline.Models.ViewModels.PerintahKerjaHarianViewModel
     
    @using PromiseOnline.Models.ViewModels
     
    @{
        IList<PkhLphDetailFleetViewModel> PkhLphDetailFleet1ViewModels = Model.PkhLphDetailFleet1ViewModels;
        IList<PkhLphDetailFleetViewModel> PkhLphDetailFleet2ViewModels = Model.PkhLphDetailFleet2ViewModels;
    }
     
    @(Html.Kendo().Grid(PkhLphDetailFleet1ViewModels)
        .Name("gridPkhDetailFleet1Preview")
        .DataSource(dataSource => dataSource
            .Ajax()
            .ServerOperation(false)
        )
    .
    .
    .
    )
  2. Preslav
    Admin
    Preslav avatar
    591 posts

    Posted 18 May 2018 Link to this post

    Hello Usep,

    For better visibility from our community, I am pasting my answer from the ticket on the same topic:

    I understand that this functionality might be important for your project, however, for the time being, it is not achievable with the Tag helpers.

    When Html helpers are used, the list of data is passed as a parameter to the constructor of the Grid. This initializes the data configuration of the dataSource:
    However, the Tag helpers have no constructor or a property that could do the same functionality. 

    Having said that, the only possible solution is to read the data as demonstrated in the demos.


    Regards,
    Preslav
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Floris Verhoeven
    Floris Verhoeven avatar
    2 posts
    Member since:
    Mar 2020

    Posted 24 Sep 2020 Link to this post

    Is it still not possible to easily achieve this? 

    <kendo-grid bind-to="@Model.Items"  /> 

    Being able to do something like the above just feels like very basic behaviour. 

  4. Preslav
    Admin
    Preslav avatar
    591 posts

    Posted 29 Sep 2020 Link to this post

    Hello Floris,

    I am sorry to say that this behavior is still not achievable with the Tag helpers, and the only possible workaround is using the HTML helpers.

     

    Regards,
    Preslav
    Progress Telerik

    Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Back to Top