Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GridDetailView closes immediately after opening #920

Closed
johannesschliesser opened this issue Oct 29, 2024 · 5 comments · Fixed by #926
Closed

GridDetailView closes immediately after opening #920

johannesschliesser opened this issue Oct 29, 2024 · 5 comments · Fixed by #926
Assignees
Labels
area-grid bug Something isn't working
Milestone

Comments

@johannesschliesser
Copy link

johannesschliesser commented Oct 29, 2024

Describe the bug
GridDetailView closes immediately after opening

To Reproduce
Steps to reproduce the behavior:

  1. Klick arrow to open GridDetailView

Expected behavior
The GridDetailView should stay open. Actually the same error occurs at the bootrap website: https://demos.blazorbootstrap.com/grid/detail-view . My code worked fine for months now. This started showing up todat 29.10.2025

Video:
https://github.com/user-attachments/assets/a2946906-6a18-4cda-84f7-2bcbacf44e08

Versions (please complete the following information):
-.NET 8
-Blazor.Bootstrap 3.0.0/3.1.0

  • Blazor Server
  • Blazor Interactive Render Mode: InteractiveServer

Sample code


@page "/testgridpage"   

@rendermode InteractiveServer

<Grid TItem="Product"
      Class="table table-hover border-top"
      Data="products"
      AllowDetailView="true">

    <GridColumns>
        <GridColumn TItem="Product" HeaderText="Id" PropertyName="Id">
            @context.Id
        </GridColumn>
        <GridColumn TItem="Product" HeaderText="Employee Name" PropertyName="Name">
            @context.Name
        </GridColumn>
        <GridColumn TItem="Product" HeaderText="Active" PropertyName="IsActive">
            @context.IsActive
        </GridColumn>
    </GridColumns>

    <GridDetailView TItem="Product">

        <Grid TItem="Ingredient"
              Class="table table-hover border-top"
              Data="GetIngredients(context.Id)">

            <GridColumns>
                <GridColumn TItem="Ingredient" Context="emp1" HeaderText="Id" PropertyName="Id">
                    @emp1.Id
                </GridColumn>
                <GridColumn TItem="Ingredient" Context="emp1" HeaderText="Description" PropertyName="Description">
                    @emp1.Description
                </GridColumn>
                <GridColumn TItem="Ingredient" Context="emp1" HeaderText="Unit" PropertyName="Unit">
                    @emp1.Unit
                </GridColumn>
                <GridColumn TItem="Ingredient" Context="emp1" HeaderText="Quantity" PropertyName="Quantity">
                    @emp1.Quantity
                </GridColumn>
            </GridColumns>

        </Grid>

    </GridDetailView>

</Grid>

@code {
    private List<Product> products = new List<Product> {
        new Product { Id = 1, Name = "Product 1", IsActive = true },
        new Product { Id = 2, Name = "Product 2", IsActive = true },
        new Product { Id = 3, Name = "Product 3", IsActive = true },
        new Product { Id = 4, Name = "Product 4", IsActive = true },
        new Product { Id = 5, Name = "Product 5", IsActive = true }
    };

    private List<Ingredient> ingredients = new List<Ingredient> {
       new Ingredient { Id = 105, ProductId = 1, Description = "Ingredient 1", Unit = "UNIT1", Quantity = 350 },
       new Ingredient { Id = 106, ProductId = 1, Description = "Ingredient 2", Unit = "UNIT1", Quantity = 600 },
       new Ingredient { Id = 107, ProductId = 1, Description = "Ingredient 3", Unit = "UNIT2", Quantity = 13 },
       new Ingredient { Id = 108, ProductId = 1, Description = "Ingredient 4", Unit = "UNIT3", Quantity = 25 },
       new Ingredient { Id = 109, ProductId = 2, Description = "Ingredient 5", Unit = "UNIT1", Quantity = 750 },
       new Ingredient { Id = 110, ProductId = 2, Description = "Ingredient 3", Unit = "UNIT2", Quantity = 13 },
       new Ingredient { Id = 111, ProductId = 1, Description = "Ingredient 4", Unit = "UNIT3", Quantity = 25 },
       new Ingredient { Id = 112, ProductId = 2, Description = "Ingredient 5", Unit = "UNIT1", Quantity = 750 },
       new Ingredient { Id = 113, ProductId = 4, Description = "Ingredient 3", Unit = "UNIT2", Quantity = 13 },
       new Ingredient { Id = 114, ProductId = 5, Description = "Ingredient 4", Unit = "UNIT3", Quantity = 25 },
       new Ingredient { Id = 115, ProductId = 2, Description = "Ingredient 5", Unit = "UNIT1", Quantity = 750 },
    };

    private IEnumerable<Ingredient> GetIngredients(int productId) => ingredients.Where(i => i.ProductId == productId);

    public record class Product
    {
        public int Id { get; set; }
        public string? Name { get; set; }
        public bool IsActive { get; set; }
    }

    public record class Ingredient
    {
        public int Id { get; set; }
        public int ProductId { get; set; }
        public string? Description { get; set; }
        public string? Unit { get; set; }
        public int Quantity { get; set; }
    }
}

Desktop (please complete the following information):

  • OS: Windows11
  • Browser: Firefox
  • Version 132.0
@fcesena-zena
Copy link

Similar problem here, it appears empty for me and in the demo pages is the same.
Restoring previous version (3.0.0) fix for me

@johannesschliesser
Copy link
Author

3.0.0: the GridDetailView content is visible and closes immediately (like in the video)
3.1.0: the content is empty

@wowraam
Copy link

wowraam commented Oct 29, 2024

Same issue with 3.1.0 but works fine when reverted to 3.0.0

@gvreddy04 gvreddy04 self-assigned this Oct 30, 2024
@gvreddy04 gvreddy04 added this to the 3.2.0 milestone Oct 30, 2024
@gvreddy04
Copy link
Contributor

3.0.0: the GridDetailView content is visible and closes immediately (like in the video) 3.1.0: the content is empty

@johannesschliesser Thank you for the detailed information.

@gvreddy04
Copy link
Contributor

GridDetailView Template now showing #923

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-grid bug Something isn't working
Projects
None yet
4 participants