We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid Filter not honering data annotation

When using Data Annotation on the model class and filling the gird with the list the headers come with the display name of the model however when using the I started using filters and in my case it is 

 Type="Syncfusion.Blazor.Grids.FilterType.Menu"

I can see the name of the property instead of the display name once the popup opens

for example:

  public class Client

    {

 [Display(Name ="ClientName")]

        public string Name { get; set; }

}

the grid filter dialog will show me "Name" as a title of the dialog instead of "ClientName"


Moreover, I noticed that the popup of the filter dialog opens so wide with the same size of the grid which is visually great and I am not sure how to override this correctly 


4 Replies

PS Prathap Senthil Syncfusion Team January 30, 2023 10:50 AM UTC

Hi Mohamed,

Greetings from Syncfusion support,

We have reviewed your issue and have created a sample based on the issue you reported in our recent version (20.4.0.44), but we were unable to reproduce the issue. We have included the sample for your reference. In order to assist in troubleshooting the issue, we kindly request that you provide a simple reproducible sample or if possible, try modifying the attached sample to see if the issue can be reproduced there. We appreciate your cooperation and hope to resolve this issue for you as soon as possible.

Regards,
Prathap S


Attachment: BlazorDataGrid_(2)_df78979c.zip


ME Mohamed Elkholy January 30, 2023 12:22 PM UTC

Hello Prathap,


I realized now that this issue occurs when using the EnableAdaptiveUI="true" on the grid 


<SfGrid TValue="Order" EnableAdaptiveUI="true" DataSource="@Orders" Height="315" AllowFiltering="true" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" })">

    <GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true"></GridEditSettings>

    <GridFilterSettings Type="Syncfusion.Blazor.Grids.FilterType.Menu"></GridFilterSettings>

    <GridColumns>

        <GridColumn Field=@nameof(Order.OrderID) TextAlign="TextAlign.Right" Width="120"></GridColumn>

        <GridColumn Field=@nameof(Order.CustomerID) Width="120"></GridColumn>

        <GridColumn Field=@nameof(Order.OrderDate) EditType="EditType.DatePickerEdit" Format="d" TextAlign="TextAlign.Right" Width="130" Type="ColumnType.Date"></GridColumn>

        <GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" TextAlign="TextAlign.Right" Format="C2" Width="120"></GridColumn>

    </GridColumns>

</SfGrid>


Attachment: Capture_c59b7389.zip


PS Prathap Senthil Syncfusion Team January 31, 2023 07:00 AM UTC

We have considered it as a bug and logged an issue  “In Adaptive mode filter dialog, column name (property name) displayed instead of Display name.” for the same. Thank you for taking the time to report this issue and helping us to improve our product. At Syncfusion, we are committed to fix all validated defects (subject to technological feasibility and Product Development Life Cycle) and this fix will be included in our upcoming patch release.

You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.       


https://www.syncfusion.com/feedback/40742/in-adaptive-mode-filter-dialog-column-name-property-name-displayed-instead-of

Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization”


Until then we appreciate your patience.

Query:”
 I noticed that the popup of the filter dialog opens so wide with the same size of the grid which is visually great and I am not sure how to override this correctly “

I'd like to inform you that in adaptive mode, the filter dialog opens to the same width as the grid which is its default behavior. Unfortunately, it is not possible to override this design.



PS Prathap Senthil Syncfusion Team February 15, 2023 05:58 AM UTC


We are glad to announce that, we have included the fix for the issue “In Adaptive mode filter dialog, column name (property name) displayed instead of Display name.in our release (20.4.0.50).  So please upgrade to our latest version of the Syncfusion NuGet package to resolve the reported issue. Please find the NuGet package for the latest fixes and features below.


Nuget: https://www.nuget.org/packages/Syncfusion.Blazor.Grid


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 



Loader.
Up arrow icon