SamovarGrid 1.0.0-alpha.3

Package Description

This is a prerelease version of SamovarGrid.
There is a newer version of this package available.
See the version list below for details.
This package has a SemVer 2.0.0 package version.
This package will only be available to download with SemVer 2.0.0 compatible NuGet clients, such as Visual Studio 2017 (version 15.3) and above or NuGet client 4.3.0 and above. Read more
The owner has unlisted this package. This could mean that the package is deprecated or shouldn't be used anymore.
Install-Package SamovarGrid -Version 1.0.0-alpha.3
dotnet add package SamovarGrid --version 1.0.0-alpha.3
<PackageReference Include="SamovarGrid" Version="1.0.0-alpha.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SamovarGrid --version 1.0.0-alpha.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

SamovarGrid. DataGrid for Blazor.

Functions

  • Sorting
  • Paging
  • Editing
  • Deleting

Prerequisites

  • Bootstrap 4
  • Open Iconic

.NET Core 3.0 download

.NET Core 3.0 download

Basic Sample

Bind Samovar Javascript file in _Host.cshtml
...
<script src="_content/SamovarGrid/samovar.grid.js"></script>
...

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>PacketServerTest</title>
    <base href="~/" />
    <link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
    <link href="css/site.css" rel="stylesheet" />
</head>
<body>
    <app>
        @(await Html.RenderComponentAsync<App>(RenderMode.ServerPrerendered))
    </app>

    <script src="_framework/blazor.server.js"></script>
    <script src="_content/SamovarGrid/samovar.grid.js"></script>
</body>
</html>

@page "/"

@using Samovar
@using Samovar.Common
@using System.Linq
@using PacketServerTest.Data
@inject WeatherForecastService ForecastService

<SamovarGrid Data="@forecasts"
             OrderFieldByDefault="@nameof(WeatherForecast.TemperatureC)"
             OrderDesc="true"
             Pageable="false"
             PageSize="25"
             Height="600px"
             PagerSize="10"
             OnRowSelected="@RowSelectedHandler"
             OnRowDeleteCommit="@RowDeleteCommitHandler"
             Headless="false">
    <SamovarGridColumns>
        <SamovarGridColumn Title="Date" Field="@nameof(WeatherForecast.Date)" />
        <SamovarGridColumn Title="TemperatureC" Field="@nameof(WeatherForecast.TemperatureC)" />
        <SamovarGridColumn Title="TemperatureF" Field="@nameof(WeatherForecast.TemperatureF)" />
        <SamovarGridColumn Title="Summary" Field="@nameof(WeatherForecast.Summary)" />
        <SamovarGridCommandColumn>
            <SamovarGridCommand CommandName="edit" CommandType=Samovar.Common.GridRowCommandType.Edit />
            <SamovarGridCommand CommandName="delete" CommandType=Samovar.Common.GridRowCommandType.Delete />
        </SamovarGridCommandColumn>
    </SamovarGridColumns>
    <SamovarGridEventManager OnRowSelected="@RowSelectedHandler" />
</SamovarGrid>

<h4>Action</h4>
<div>@selectedAction</div>

<h4>Action row item</h4>
<div>@actionItem</div>

@code{
    string selectedAction { set; get; }
    string actionItem { set; get; }

    List<WeatherForecast> forecasts;

    protected override async Task OnInitializedAsync()
    {
        forecasts = (await ForecastService.GetForecastAsync(DateTime.Now)).ToList();
    }

    void RowSelectedHandler(GridRowEventArgs args)
    {
        actionItem = ((WeatherForecast)args.RowData).Summary;
        selectedAction = "RowSelected";
    }

    void RowDeleteCommitHandler(GridRowEventArgs args)
    {
        actionItem = ((WeatherForecast)args.RowData).Summary;
        this.forecasts.Remove((WeatherForecast)args.RowData);
        selectedAction = "RowDeleteCommit";
    }
}

SamovarGrid. DataGrid for Blazor.

Functions

  • Sorting
  • Paging
  • Editing
  • Deleting

Prerequisites

  • Bootstrap 4
  • Open Iconic

.NET Core 3.0 download

.NET Core 3.0 download

Basic Sample

Bind Samovar Javascript file in _Host.cshtml
...
<script src="_content/SamovarGrid/samovar.grid.js"></script>
...

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>PacketServerTest</title>
    <base href="~/" />
    <link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
    <link href="css/site.css" rel="stylesheet" />
</head>
<body>
    <app>
        @(await Html.RenderComponentAsync<App>(RenderMode.ServerPrerendered))
    </app>

    <script src="_framework/blazor.server.js"></script>
    <script src="_content/SamovarGrid/samovar.grid.js"></script>
</body>
</html>

@page "/"

@using Samovar
@using Samovar.Common
@using System.Linq
@using PacketServerTest.Data
@inject WeatherForecastService ForecastService

<SamovarGrid Data="@forecasts"
             OrderFieldByDefault="@nameof(WeatherForecast.TemperatureC)"
             OrderDesc="true"
             Pageable="false"
             PageSize="25"
             Height="600px"
             PagerSize="10"
             OnRowSelected="@RowSelectedHandler"
             OnRowDeleteCommit="@RowDeleteCommitHandler"
             Headless="false">
    <SamovarGridColumns>
        <SamovarGridColumn Title="Date" Field="@nameof(WeatherForecast.Date)" />
        <SamovarGridColumn Title="TemperatureC" Field="@nameof(WeatherForecast.TemperatureC)" />
        <SamovarGridColumn Title="TemperatureF" Field="@nameof(WeatherForecast.TemperatureF)" />
        <SamovarGridColumn Title="Summary" Field="@nameof(WeatherForecast.Summary)" />
        <SamovarGridCommandColumn>
            <SamovarGridCommand CommandName="edit" CommandType=Samovar.Common.GridRowCommandType.Edit />
            <SamovarGridCommand CommandName="delete" CommandType=Samovar.Common.GridRowCommandType.Delete />
        </SamovarGridCommandColumn>
    </SamovarGridColumns>
    <SamovarGridEventManager OnRowSelected="@RowSelectedHandler" />
</SamovarGrid>

<h4>Action</h4>
<div>@selectedAction</div>

<h4>Action row item</h4>
<div>@actionItem</div>

@code{
    string selectedAction { set; get; }
    string actionItem { set; get; }

    List<WeatherForecast> forecasts;

    protected override async Task OnInitializedAsync()
    {
        forecasts = (await ForecastService.GetForecastAsync(DateTime.Now)).ToList();
    }

    void RowSelectedHandler(GridRowEventArgs args)
    {
        actionItem = ((WeatherForecast)args.RowData).Summary;
        selectedAction = "RowSelected";
    }

    void RowDeleteCommitHandler(GridRowEventArgs args)
    {
        actionItem = ((WeatherForecast)args.RowData).Summary;
        this.forecasts.Remove((WeatherForecast)args.RowData);
        selectedAction = "RowDeleteCommit";
    }
}

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 26 10/30/2019