SfGrid's grouping feature does not work.

Hi. I'm unae.

SfGrid's grouping feature does not work.
but it works after F5 key press.

thank you.

Syncfusion.Blazor ver : 19.1.0.55
Visual Studio : 2019 (16.9.2)

<SfGrid @ref="Grid" DataSource="@Items" EnableVirtualization="false" Height="auto"
            GridLines="GridLine.Both" ShowColumnChooser="true" Toolbar="@(new List<string>() { "Search" })"
            AllowGrouping="true" AllowSorting="true" AllowFiltering="true" AllowReordering="true" AllowSelection="true" AllowPaging="true" AllowExcelExport="true">
        <GridFilterSettings Type="Syncfusion.Blazor.Grids.FilterType.Excel"></GridFilterSettings>
        <GridSelectionSettings Type="Syncfusion.Blazor.Grids.SelectionType.Multiple"></GridSelectionSettings>
        <GridPageSettings PageSizes="true"></GridPageSettings>
        <GridColumns>
            @if (Items.Count > 0)
            {
                foreach (var pair in Items[0])
                {
                    <GridColumn Field="@pair.Key"></GridColumn>
                }
            }
        </GridColumns>
    </SfGrid>


Attachment: Grid_46cf7e4b.zip

5 Replies 1 reply marked as answer

JP Jeevakanth Palaniappan Syncfusion Team April 13, 2021 04:03 PM UTC

Hi unae, 

Greetings from Syncfusion support. 

We are not clear about the exact scenario you are facing this reported problem. We tried to reproduce this scenario by creating a sample based on the shared codes, but grouping works fine with the sample from our side. Please download the sample from the link below, 

Kindly refer the above attached sample, and if you are still facing difficulties then the following details would be helpful for us to proceed further. 

  1. Share the exact scenario you are facing this reported problem.
  2. Share with us a video demo showing the replication of the problem you are facing.
  3. Share with us a simple issue reproducing sample or if possible reproduce with the above attached sample and share with us for further analysis.
  4. Share with us the details of exception, if any occurred while performing grouping in Grid.

The provided information will help us analyze the problem, and provide you a solution as early as possible. 

Regards, 
Jeevakanth SP. 



UN unae April 14, 2021 02:47 PM UTC

thanks for the quick reply. please check the file I have attached.

I want to create the column dynamically. because it will run the query on the database.

Attachment: SfGridGroupTest_517693c1.zip


JP Jeevakanth Palaniappan Syncfusion Team April 19, 2021 04:48 AM UTC

Hi Unae, 

Greetings from Syncfusion support. 

We have validated your query and the Blazor doesn't detect the existing Dom element changes dynamically. So we suggest you to modify the code as like below to resolve your issue. 

<div> 
    @if (Items.Count == 0) 
    { 
        <SfGrid @ref="Grid" DataSource="@Items" 
                AllowGrouping="true" AllowPaging="true"> 
        </SfGrid> 
    } 
    else 
    { 
        <SfGrid @ref="Grid" DataSource="@Items" 
                AllowGrouping="true" AllowPaging="true"> 
            <GridColumns> 
                @foreach (var pair in Items[0]) 
                { 
                    <GridColumn Field="@pair.Key"></GridColumn> 
                } 
            </GridColumns> 
        </SfGrid> 
    } 
</div> 

Please find the sample below for your reference. 


Regards, 
Jeevakanth SP. 


Marked as answer

UN unae April 19, 2021 06:10 AM UTC

the problem is solved. thanks for the quick reply.


JP Jeevakanth Palaniappan Syncfusion Team April 20, 2021 04:24 AM UTC

Hi Unae, 

Thanks for the update. Please get back to us if you have any other queries. 

Regards, 
Jeevakanth SP. 


Loader.
Up arrow icon