ActionBeginHandler args.RowData is null

Hello

Somewhere between verion 19.3.0.53 and 19.3.0.59 the code below broke.  The RowData highighted is null in 19.3.0.59, but was populated with data in 19.3.053.

Any ideas

Thanks



3 Replies

RN Rahul Narayanasamy Syncfusion Team January 13, 2022 12:57 PM UTC

Hi Ditchford, 

Greetings from Syncfusion. 

Query: ActionBeginHandler args.RowData is null 

We have validated your query and we would like to inform you that while start editing, the OnActionBeign event will be called two times with RequestType as BeforeBeginEdit and BeginEdit(from version 19.3.0.57). In BeforeBeginEdit request type, the args.RowData value will be null. You can get the args.RowData value in BeginEdit request type. 

Since you have checked the condition that whether the “Edit” word is present in the RequestType or not(using contains -> (args.RequestType.ToString().Contains(“Edit”))). So the condition becomes true in first RequestType(BeforeBeginEdit) itself. So the args.RowData value getting null.  

So we suggest you to check the RequestType(as BeginEdit) as like below to resolve the problem. Find the below code snippets for your reference. 

 
<SfGrid DataSource="@Orders" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })" Height="315"> 
    <GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Normal"></GridEditSettings> 
    <GridEvents OnActionBegin="ActionBeginHandler" TValue="Order"></GridEvents> 
    <GridColumns> 
        <GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" IsPrimaryKey="true" ValidationRules="@(new ValidationRules{ Required=true})" TextAlign="TextAlign.Right" Width="120"></GridColumn> 
        . . . 
    </GridColumns> 
</SfGrid> 
 
@code{ 
    public List<Order> Orders { get; set; } 
 
    public void ActionBeginHandler(ActionEventArgs<Order> args) 
    { 
        if (args.RequestType.Equals(Syncfusion.Blazor.Grids.Action.BeginEdit)) 
        { 
            // Here you can customize your code with args.RowData 
        } 
    } 
 
    . . . 
} 

Please let us know if you have any concerns. 

Regards, 
Rahul 



DI Ditchford January 13, 2022 04:45 PM UTC

Hey


Excellent...thank you



RN Rahul Narayanasamy Syncfusion Team January 14, 2022 03:51 AM UTC

Hi Ditchford, 

Thanks for the update. 

We are happy to hear that the provided solution was helpful. Please get back to us if you need further assistance. 

Regards, 
Rahul 


Loader.
Up arrow icon