This is a migrated thread and some comments may be shown as answers.

Tag Helper on Grid with Local Datasource

3 Answers 409 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Usep
Top achievements
Rank 1
Usep asked on 18 May 2018, 07:04 AM

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)
    )
.
.
.
)

3 Answers, 1 is accepted

Sort by
0
Preslav
Telerik team
answered on 18 May 2018, 11:09 AM
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.
0
Floris
Top achievements
Rank 1
Iron
answered on 24 Sep 2020, 09:09 PM

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. 

0
Preslav
Telerik team
answered on 29 Sep 2020, 12:03 PM

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).

Tags
Grid
Asked by
Usep
Top achievements
Rank 1
Answers by
Preslav
Telerik team
Floris
Top achievements
Rank 1
Iron
Share this question
or