Is it possible to group by a dropdown column?

Hi,

when I drag a dropdown column header to the grouping area, all the data in my grid disappears. The grid aggregate is still visible but no data. Is there a way to make this work?

Thank you

5 Replies 1 reply marked as answer

JP Jeevakanth Palaniappan Syncfusion Team June 10, 2021 05:47 AM UTC

Hi Yannick, 

Greetings from Syncfusion support. 

We have checked your query and we suspect that when you group a aggregate defined column, the grouped column is not visible in the grid and other columns are visible. For this, we suggest you to set the ShowGroupedColumn of GridGroupSettings component as true to show the grouped column in the UI. Please refer the below code snippet and the sample for your reference. 

<SfGrid DataSource="@Orders" AllowPaging="true" AllowGrouping="true"> 
    <GridGroupSettings ShowGroupedColumn="true"></GridGroupSettings> 
.. 
</SfGrid> 


Please get back to us if you have any other queries. 

Regards, 
Jeevakanth SP. 



YA Yannick June 10, 2021 04:12 PM UTC

Hi, 

thank you for the reply but the problem is that all the data from the table disappears, not only the data from the dropdown column. Please view the attached images. 
Here is my code for the dropdown column.

<GridColumn Field=@nameof(BetonColonneVM.BetonColonneType) EnableGroupByFormat="true" HeaderText="Code" EditType="EditType.DropDownEdit" TextAlign="TextAlign.Right" Width="100" AllowEditing="true" >
<Template>
@{
var ctx = (context as BetonColonneVM);
if (ctx.BetonColonneType != null)
{
<span>@ctx.BetonColonneType.Code</span>
}
}
</Template>
<EditTemplate>
<SfDropDownList ID="ddown" Placeholder="Choisir un type" TItem="BetonColonneTypeVM" TValue="BetonColonneTypeVM" @bind-Value="@((context as BetonColonneVM).BetonColonneType)" DataSource="ColonneTypes">
<DropDownListEvents TValue="BetonColonneTypeVM" TItem="BetonColonneTypeVM" ValueChange="ValueChange"></DropDownListEvents>
<DropDownListFieldSettings Text="Code" Value="BetonColonneTypeVM"></DropDownListFieldSettings>
</SfDropDownList>
</EditTemplate>
</GridColumn>

Thank you.

Attachment: Bureau_9065df4c.7z


JP Jeevakanth Palaniappan Syncfusion Team June 11, 2021 06:50 AM UTC

Hi Yannick, 

We have checked the reported problem by preparing a sample in the latest version (19.1.0.67) but unfortunately we are unable to reproduce the reported problem from our end. Please refer the below validated sample for your reference. 


To further validate the reported problem, we suggest you to share us the below details, 

  1. Share us the Syncfusion NuGet version details.
  2. Provide us the issue reproducing sample or reproduce the issue in the above provided sample.

The above requested details will be helpful for us to validate the problem and to provide you with a better solution as early as possible. 

Regards, 
Jeevakanth SP. 




YA Yannick June 11, 2021 02:16 PM UTC

Hi, I was using a class in my field instead of a string or primitive type. Changing it to its ID (int), it works properly. Thank you


Field=@nameof(BetonColonneVM.BetonColonneTypeId) instead of Field=@nameof(BetonColonneVM.BetonColonneType)

Marked as answer

JP Jeevakanth Palaniappan Syncfusion Team June 14, 2021 05:29 AM UTC

Hi Yannick, 

We are glad that you have resolved the reported problem. Please get back to us if you have any other queries. 

Regards, 
Jeevakanth SP. 


Loader.
Up arrow icon