Extensions

« Form2
Name Movie Genre
Star Wars Sci-Fi Details
Reservoir Dogs Thriller Details
Airplane! Slapstick Details
Terminator Action Details
Terminator 2: Judgement Day Action Details
Wonder Woman 1984 Action Details
Close Encounters of the Third Kind Sci-Fi Details
Rocky Action Details
Brave Heart Action Details
Movie with <b>bold</b> Test Details
The Godfather Mob Details
Citizen Kane Drama Details
The Shawshank Redemption Drama Details
Pulp Fiction Action Details
Casablanca Drama Details
2001: A Space Odyssey Sci-Fi Details

Grid

@(await Html
    .SimpleGrid(Model)
    .AddColumnFor(movie => movie.Name)
    .AddColumnFor(movie => movie.Genre)
    .AddColumn(col => col
        .MyGoogleSearchButton("Details", movie => movie.Name))
    .MyFavoriteGridStuff()
    .RenderAsync())

Custom Extensions

public static SimpleGrid<T> MyFavoriteGridStuff<T>(
    this SimpleGrid<T> grid) where T : class 
    => grid
        .Css(elements => elements.Table.AddClass("table-striped"))
        .AddPager(options =>
        {
            options.TopAndBottom();
            options.RowsPerPage = 5;
            options.RowsPerPageOptions = new[] { 5, 10, 25 };
        });

public static ColumnBuilder<T> MyGoogleSearchButton<T>(
    this ColumnBuilder<T> col,
    string text,
    Func<T, string> queryBuilder) where T : class 
    => col
        .Display(text)
        .LinkTo(
            linkBuilder: model =>
            {
                string query = queryBuilder(model);
                string encoded = System.Web.HttpUtility.UrlEncode(query);
                return $"https://www.google.com/search?q={encoded}";
            }, 
            target: "_blank",
            css: css => css.AddClass("btn btn-primary"));

You can create your own extensions for either the entire Grid, or for Column Builder to encapsulate common setup you use in your app. Just copy and paste these templates above into your own static extension class and modify to your needs.