EditMode error when <GridCommandColumns> is present

i'm using your sample code below with SyncFusion Blazor 18.2.0.59 because it's similar to what I'm using in my project
I only added the Mode="EditMode.Dialog" in GridEditSettings to show the dialogbox 
If you doubleclick on a row and click on save button this error is generated:

blazor.server.js:15 [2020-09-27T21:02:39.825Z] Error: 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.SfGrid`1.EndEdit()
   at Syncfusion.Blazor.Grids.Internal.DialogEdit`1.<BuildRenderTree>b__0_9()
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Syncfusion.Blazor.Internal.SfBaseUtils.InvokeEvent[T](Object eventFn, T eventArgs)
   at Syncfusion.Blazor.Buttons.SfButton.OnClickHandler(MouseEventArgs args)
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle) 

if you remove the lines highlighted in green below, everything works, why ? which PropertyName is missing ?


@using Syncfusion.Blazor.Grids

<SfGrid DataSource="@Orders" AllowPaging="true" Height="315">
    <GridEvents CommandClicked="OnCommandClicked" TValue="Order"></GridEvents>
    <GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Dialog"></GridEditSettings>
    <GridColumns>
        <GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" IsPrimaryKey="true" TextAlign="TextAlign.Right" Width="120"></GridColumn>
        <GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="120"></GridColumn>
        <GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" EditType="EditType.DatePickerEdit" Format="d" TextAlign="TextAlign.Right" Width="130"></GridColumn>
        <GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
        <GridColumn HeaderText="Manage Records" Width="150">
            <GridCommandColumns>
                <GridCommandColumn ButtonOption="@(new CommandButtonOptions() { Content = "Details", CssClass = "e-flat" })"></GridCommandColumn>
            </GridCommandColumns>
        </GridColumn>
    </GridColumns>
</SfGrid>

@code{
    public List<Order> Orders { get; set; }

    protected override void OnInitialized()
    {
        Orders = Enumerable.Range(1, 75).Select(x => new Order()
        {
            OrderID = 1000 + x,
            CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],
            Freight = 2.1 * x,
            OrderDate = DateTime.Now.AddDays(-x),
            ShipCountry = (new string[] { "USA", "UK", "CHINA", "RUSSIA", "INDIA" })[new Random().Next(5)]
        }).ToList();
    }

    public class Order
    {
        public int? OrderID { get; set; }
        public string CustomerID { get; set; }
        public DateTime? OrderDate { get; set; }
        public double? Freight { get; set; }
        public string ShipCountry { get; set; }
    }

    public void OnCommandClicked(CommandClickEventArgs<Order> args)
    {
        // Perform required operations here
    }
}


3 Replies 1 reply marked as answer

JP Jeevakanth Palaniappan Syncfusion Team September 28, 2020 01:11 PM UTC

Hi Walter, 

Greetings from Syncfusion support. 
 
We are able to reproduce the reported problem with our version(18.2.0.59) when having command column in Grid. We have confirmed it is a bug and logged the defect report “Exception is thrown while saving the changes in grid with CommandColumns”. 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  bi-weekly 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, 
Jeevakanth SP. 



WM Walter Martin October 5, 2020 07:54 AM UTC

I confirm you that the problem has been solved in version 18.3.0.35
thank you


Marked as answer

JP Jeevakanth Palaniappan Syncfusion Team October 6, 2020 05:40 AM UTC

Hi Walter, 

Thanks for the update. We are happy that your issue has been resolved. Please get back to us if you have any further queries. 

Regards, 
Jeevakanth SP. 


Loader.
Up arrow icon