Hello!
Using EF Core if I try to filter a GUID type column it's not wroking. It only works with the full value of the GUID but if i try to use "start with", "contains" etc. or it's not returning anything.
Anyone with the same issue or a solution?
Hi Boldizsár,
By default, GUID is a Global unique identifier, and it generates only the unique value. Using this GUID, while performing the filtering with startswith operator for some part of value and endswith operator for some part of the value is not a valid case. We have to filter this GUID with whole value and performing the filtering with equal operator is a valid case similarly the same functionality will work in the EJ2 Grid. So, we suggest you filter the GUID column only with equal operator and achieve your requirement.
Since by default in the filter menu, it was showing startswith operator and you have the option to change the default filter operator for particular column by using filter.operator property of Column Model. So, you can set the default operator to the GUID column as equal operator. Please refer the below code example for more information.
|
<ejs-grid id="Grid" allowPaging='true' allowFiltering='true' allowSorting="true" toolbar="@(new List<string>() { "Add", "Edit", "Delete","Update","Cancel" })"> <e-grid-pagesettings pageSize="7" /> <e-grid-filterSettings type="Menu"></e-grid-filterSettings> <e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true" mode="Normal"></e-grid-editSettings> <e-data-manager url="@Url.Action("UrlDataSource", "Home")" insertUrl="/Home/Insert" updateUrl="/Home/Update" removeUrl="/Home/Remove" adaptor="UrlAdaptor" /> <e-grid-columns> //set the default operator as equal for the GUID column <e-grid-column field="id" filter="@(new { @operator="equal"})" type="string" headerText="Order ID" isPrimaryKey="true" textAlign="Right" width="120"></e-grid-column> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
</e-grid-columns> </ejs-grid>
|
Regards,
Dineshnarasimman M
Thanks for your reply! I understand that GUID generates a Unique value but at the same time why shouldn't i be able to filter it with startswith, contains etc.
If this can't be done is there a way to not only set the default filter but to limit the filter to only show Equal in that column? Also because of the error the filter shows a small popup with the following text: "Request failed" is there a way do disable that?
Looking forward to your answer!
Hi Boldizsár,
We noticed that you have already created a Support Ticket for this query regarding using this GUID, while performing the filtering . Please follow up on the support ticket for further updates that was created under your account.
Regards,
Dineshnarasimman M