Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Working Grid with Template
@page "/fetchdata"
@inject HttpClient Http
@using Telerik.Blazor.Components.Grid
<h1>Weather forecast</h1>
<p>This component demonstrates fetching data from the server.</p>
<TelerikGrid Data="@forecasts" Pageable="true" Sortable="true" Filterable="true">
<TelerikGridColumn Field="Date">
@((context as WeatherForecast).Date.ToShortDateString())
<TelerikGridColumn Field="TemperatureC" Title="Temp C'" />
<TelerikGridColumn Field="TemperatureF" Title="Temp F'" />
<TelerikGridColumn Field="Summary" />
@code {
WeatherForecast[] forecasts;
protected override async Task OnInitializedAsync()
forecasts = await Http.GetJsonAsync<WeatherForecast[]>("sample-data/weather.json");
class WeatherForecast
public DateTime Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF { get; set; }
public string Summary { get; set; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.