Blazor Components Summary RRS feed

  • Question

  • User2041008840 posted

    I have created a bunch of blazor wasm components for reusability and reduce line of code. 
    I want to give the summary info for it. Like when I hover the tag
    <GridView></GridView> It should show the summary info or tooltip that 

    "The table element which is mostly used to show data in table form" like that or something. 

    Is it possible? 

    Saturday, May 22, 2021 5:10 AM

All replies

  • User1535942433 posted

    Hi Prathamesh Shende,

    As far as I think, HTML and Razor markup are placed in a Razor file (.razor). C# code is placed in a code-behind file defined as a partial class (.cs) to show the summary.

    Just like this:


    @typeparam TItem
    <table class="table">
            @foreach (var item in Items)


    using Microsoft.AspNetCore.Components;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    namespace WebApplication23.Shared
        /// <summary>
    /// This is TestTable,it is a TableTemplate component
    /// </summary>
    public partial class TestTable<TItem>{

    /// <param name="TableHeader">It is a TableHeader</param>
    public RenderFragment TableHeader { get; set; }
    /// <param name="RowTemplate">It is a RowTemplate</param>
    public RenderFragment<TItem> RowTemplate { get; set; }
    /// <param name="Items">It is datasource</param>
    public IReadOnlyList<TItem> Items { get; set; }
    } }


    <TestTable Items="pets" Context="pet">
    @code {
        private List<Pet> pets = new()
            new Pet { PetId = 2, Name = "Mr. Bigglesworth" },
            new Pet { PetId = 4, Name = "Salem Saberhagen" },
            new Pet { PetId = 7, Name = "K-9" }
        private class Pet
            public int PetId { get; set; }
            public string Name { get; set; }


    Note:It may run slow.

    More details,you could refer to below articles:



    Best regards,

    Yijing Sun

    Monday, May 24, 2021 9:55 AM