ArgumentNullException - Add new record
Blazor Client
<PackageReference Include="Syncfusion.Blazor" Version="18.2.0.59" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.DataAnnotations.Validation" Version="3.2.0-rc1.20223.4" />
I'm using the
SfGrid -> Adaptor="Adaptors.UrlAdaptor"
and want to add a new record. The event ActionFailureHandler doesn't handle the exception.
How could i debug / handle the following error? Similar post: https://www.syncfusion.com/feedback/18058/unable-to-edit-delete-records-doesnt-render-without-columns
Uncaught (in promise) Error: System.ArgumentNullException: Value cannot be null.
Parameter name: propertyName
at System.ComponentModel.DataAnnotations.ValidationAttributeStore+TypeStoreItem.TryGetPropertyStoreItem (System.String propertyName, System.ComponentModel.DataAnnotations.ValidationAttributeStore+PropertyStoreItem& item) <0x66309e8 + 0x0001c> in <filename unknown>:0
at System.ComponentModel.DataAnnotations.ValidationAttributeStore+TypeStoreItem.GetPropertyStoreItem (System.String propertyName) <0x6630858 + 0x00012> in <filename unknown>:0
at System.ComponentModel.DataAnnotations.ValidationAttributeStore.GetPropertyType (System.ComponentModel.DataAnnotations.ValidationContext validationContext) <0x6628b70 + 0x00032> in <filename unknown>:0
at System.ComponentModel.DataAnnotations.Validator.TryValidateProperty (System.Object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext, System.Collections.Generic.ICollection`1[T] validationResults) <0x6628760 + 0x00010> in <filename unknown>:0
at Syncfusion.Blazor.Grids.Internal.Editors.ColumnsValidator`1[T].DataAnnotationHandler (Microsoft.AspNetCore.Components.Forms.FieldIdentifier identifier) <0x666e458 + 0x000b2> in <filename unknown>:0
at Syncfusion.Blazor.Grids.Internal.Editors.ColumnsValidator`1[T].ValidateRequested (System.Object editContext, Microsoft.AspNetCore.Components.Forms.ValidationRequestedEventArgs validationEventArgs) <0x66c1b30 + 0x00088> in <filename unknown>:0
at (wrapper delegate-invoke) System.EventHandler`1[Microsoft.AspNetCore.Components.Forms.ValidationRequestedEventArgs].invoke_void_object_TEventArgs(object,Microsoft.AspNetCore.Components.Forms.ValidationRequestedEventArgs)
at Microsoft.AspNetCore.Components.Forms.EditContext.Validate () <0x66a9b20 + 0x0001e> in <filename unknown>:0
at Syncfusion.Blazor.Grids.Internal.Edit`1[T].EndEdit () <0x66a8dc0 + 0x0032c> in <filename unknown>:0
at Syncfusion.Blazor.Grids.Internal.GridToolbar`1[T].ToolbarClickHandler (Syncfusion.Blazor.Navigations.ClickEventArgs args) <0x5f031f0 + 0x0071a> in <filename unknown>:0
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion (System.Threading.Tasks.Task task) <0x4052978 + 0x000da> in <filename unknown>:0
at Syncfusion.Blazor.Navigations.SfToolbar.TriggerClickEvent (Microsoft.AspNetCore.Components.Web.MouseEventArgs e, System.Boolean isPopupElement, System.Boolean isCloseIcon, System.Nullable`1[T] trgParentDataIndex) <0x5ef55d8 + 0x003fe> in <filename unknown>:0
at Object.endInvokeDotNetFromJS (blazor.webassembly.js:1)
at Object.invokeJSFromDotNet (blazor.webassembly.js:1)
at _mono_wasm_invoke_js_marshalled (dotnet.3.2.0.js:1)
at do_icall (<anonymous>:wasm-function[6049]:0x10f8b1)
at do_icall_wrapper (<anonymous>:wasm-function[1896]:0x50b6a)
at interp_exec_method (<anonymous>:wasm-function[1120]:0x2588e)
at interp_runtime_invoke (<anonymous>:wasm-function[5655]:0xf7391)
at mono_jit_runtime_invoke (<anonymous>:wasm-function[5109]:0xddb3d)
at do_runtime_invoke (<anonymous>:wasm-function[1410]:0x3ba85)
at mono_runtime_try_invoke (<anonymous>:wasm-function[418]:0xcfdb)
SIGN IN To post a reply.
3 Replies
BL
Blazor
September 27, 2020 09:41 AM UTC
My problem was same with this issue;
https://www.syncfusion.com/forums/158036/grid-bug-since-18-2-0-58
https://www.syncfusion.com/forums/158036/grid-bug-since-18-2-0-58
My problem was same with this issue;
https://www.syncfusion.com/forums/158036/grid-bug-since-18-2-0-58
Thank you for the support and workaround.
Yes it works :-)
I use the UrlAdapter. Insert dummy [NotMapped] Field in the dto:
<GridColumn Field="@nameof(FinanceAccount.DummyField)" HeaderText="Details" Width="14" AllowAdding="false" AllowEditing="false" AllowFiltering="false" AllowGrouping="false" AllowReordering="false" AllowSearching="false"AllowSorting="false" >
<Template>
@{
var financeAccountRow = (context as FinanceAccount);
var urlTransactions = ApplicationConsts.MainMenu.FinanceAccounts + "/" + financeAccountRow.Id + "/" + financeAccountRow.Name;
<div><a rel='nofollow' href="@urlTransactions"><span class="e-icons e-edit"></span></a></div>
}
</Template>
</GridColumn>
Appreciate your help!
VN
Vignesh Natarajan
Syncfusion Team
September 28, 2020 04:32 AM UTC
Hi Dom / Blazor,
Thanks for the update.
We are glad to hear that you have resolved the query using the workaround suggested in F158036.
Fix for the reported issue will be included in our 2020 Volume 3 release expected to be rolled out by end of this month September 2020.
Please get back to us if you have further queries.
Regards,
Vignesh Natarajan
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
-
DO Dom
- Sep 25, 2020 02:48 PM UTC
- Sep 28, 2020 04:32 AM UTC