Grid bug since 18.2.0.58?
Hi There,
I have a grid as follows:
<SfGrid @ref="AnswersGrid" DataSource="@AnswerList" Toolbar="@(new List<string>() { "Add", "Double Click On A Row To Edit"})" AllowSelection="true" AllowPaging="false" AllowSorting="true" AllowFiltering="false" AllowTextWrap="false">
<GridEditSettings AllowEditOnDblClick="true" AllowAdding="true" AllowDeleting="true" AllowEditing="true" Mode="EditMode.Normal" NewRowPosition="NewRowPosition.Bottom"></GridEditSettings>
<GridEvents OnActionComplete="OnActionCompleteHandler" TValue="Answer"></GridEvents>
<GridSortSettings>
<GridSortColumns>
<GridSortColumn Field="@nameof(Answer.Label)" Direction="SortDirection.Ascending"></GridSortColumn>
</GridSortColumns>
</GridSortSettings>
<GridColumns>
<GridColumn AllowSorting="false" Field="@nameof(Answer.OrgId)" Visible="false" DefaultValue="@Element.OrgId" />
<GridColumn AllowSorting="true" Field="@nameof(Answer.Label)" Width="100" IsPrimaryKey="true" HeaderText="Label" DefaultValue="@DefaultLabelValue" ValidationRules="@(new ValidationRules{ Required = true, MinLength = 1, MaxLength = 20})" />
<GridColumn AllowSorting="false" Field="@nameof(Answer.Points)" Width="100" HeaderText="Points" DefaultValue="0" ValidationRules="@(new ValidationRules { Required = true, Number = true , Min = 0})" />
<GridColumn AllowSorting="false" Field="@nameof(Answer.Value)" HeaderText="Answer Value" DefaultValue="@DefaultAnswerValue" ValidationRules="@(new ValidationRules { Required = true })" />
<GridColumn HeaderText="Change" Width="100">
<GridCommandColumns>
<GridCommandColumn Type="CommandButtonType.Edit" ButtonOption="@(new CommandButtonOptions() {CssClass="e-success", IconCss = "fa fa-pencil"})" />
<GridCommandColumn Type="CommandButtonType.Delete" ButtonOption="@(new CommandButtonOptions() {CssClass="e-danger", IconCss = "fa fa-trash"})" />
<GridCommandColumn Type="CommandButtonType.Save" ButtonOption="@(new CommandButtonOptions() {CssClass="e-success", IconCss="fa fa-save"})" />
<GridCommandColumn Type="CommandButtonType.Cancel" ButtonOption="@(new CommandButtonOptions() {CssClass="e-flat", IconCss="fa fa-times" })" />
</GridCommandColumns>
</GridColumn>
</GridColumns>
</SfGrid>
Which has been working fine for a while. Recently I upgraded to 18.2.0.58 , and it seems that the validation is now broken. The following exception is now thrown after I edit something in the grid.
2020-09-22 15:03:40.656 +12:00 [WRN] Unhandled exception rendering component: Value cannot be null. (Parameter 'propertyName')
System.ArgumentNullException: Value cannot be null. (Parameter 'propertyName')
at System.ComponentModel.DataAnnotations.ValidationAttributeStore.TypeStoreItem.TryGetPropertyStoreItem(String propertyName, PropertyStoreItem& item)
at System.ComponentModel.DataAnnotations.ValidationAttributeStore.TypeStoreItem.GetPropertyStoreItem(String propertyName)
at System.ComponentModel.DataAnnotations.ValidationAttributeStore.GetPropertyType(ValidationContext validationContext)
at System.ComponentModel.DataAnnotations.Validator.TryValidateProperty(Object value, ValidationContext validationContext, ICollection`1 validationResults)
at Syncfusion.Blazor.Grids.Internal.Editors.ColumnsValidator`1.DataAnnotationHandler(FieldIdentifier identifier)
at Syncfusion.Blazor.Grids.Internal.Editors.ColumnsValidator`1.ValidateRequested(Object editContext, ValidationRequestedEventArgs validationEventArgs)
at Microsoft.AspNetCore.Components.Forms.EditContext.Validate()
at Syncfusion.Blazor.Grids.Internal.Edit`1.EndEdit()
at Syncfusion.Blazor.Grids.Internal.GridCellBase`1.CellClickHandler(MouseEventArgs e, Boolean IsCheckBox)
at Syncfusion.Blazor.Grids.Internal.GridCell`1.<BuildRenderTree>b__0_5(MouseEventArgs e)
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
Now I am not trying to use data annotations, although the underlying model for the grid ("Answer") does have some annotations. But then, it was not a problem before - the grid still worked just fine.
But its broken in the latest update. Any ideas?
SIGN IN To post a reply.
5 Replies
1 reply marked as answer
RS
Renjith Singh Rajendran
Syncfusion Team
September 22, 2020 12:40 PM UTC
Hi Joseph,
Greetings from Syncfusion support.
We are able to face the reported problem with our latest version(18.2.0.58) when having CommandColumn in Grid. We have confirmed it is a bug and logged the defect report “Exception is thrown while saving the changes in grid with CommandColumn”. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and including the defect fix in our upcoming Volume 3, 2020 release which is expected to be rolled out by the end of September, 2020.
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.
Until then we appreciate your patience.
Regards,
Renjith Singh Rajendran
JT
Joseph Tan
September 23, 2020 10:45 PM UTC
Is there a workaround in the meantime?
RS
Renjith Singh Rajendran
Syncfusion Team
September 24, 2020 12:56 PM UTC
Hi Joseph,
Thanks for your update.
As promised in our previous update, we will fix this issue in our upcoming Volume 3, 2020 release, which is expected to be rolled out by the end of September 2020.
Based on your update, as a workaround we suggest you to define the dummy name for the Field property of GridColumn for the GridCommandColumn to overcome this problem. Please refer and use as like the below code.
|
<GridColumn Field="DummyField" HeaderText="Manage Records" Width="150">
<GridCommandColumns>
<GridCommandColumn Type="CommandButtonType.Edit" ButtonOption="@(new CommandButtonOptions() { IconCss = "e-icons e-edit", CssClass = "e-flat" })"></GridCommandColumn>
<GridCommandColumn Type="CommandButtonType.Delete" ButtonOption="@(new CommandButtonOptions() { IconCss = "e-icons e-delete", CssClass = "e-flat" })"></GridCommandColumn>
...
</GridCommandColumns>
</GridColumn>
|
We have also prepared a sample based on the above suggestion, please download the sample from the link below,
Once our Volume 3,2020 release is rolled out, then there is no need for using the above suggested Field property.
Please get back to us if you need further assistance.
Regards,
Renjith R
Marked as answer
JT
Joseph Tan
September 24, 2020 09:25 PM UTC
Thanks.
That worked.
Having a workaround is important because you might have a fix for this bug in the upcoming release, but you might also break something else, which means I wouldn't be able to upgrade to it.
VN
Vignesh Natarajan
Syncfusion Team
September 25, 2020 10:42 AM UTC
Hi Joseph,
Thanks for the update.
We will get back to you once our 2020 Volume 3 release gets successfully rolled out along with the fix for the reported issue.
Till then we appreciate your patience.
Regards,
Vignesh Natarajan
SIGN IN To post a reply.
- 5 Replies
- 3 Participants
- Marked answer
-
JT Joseph Tan
- Sep 22, 2020 03:30 AM UTC
- Sep 25, 2020 10:42 AM UTC