We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How get primary key after add object

I using SfDataManager and after I add new object in method InsertAsync, I can't get primary key in method

OnActionComplete


Attachment: OnActionCompleteForSfTeem_20b0e750.zip

1 Reply 1 reply marked as answer

PS Prathap Senthil Syncfusion Team January 5, 2023 08:53 AM UTC

Hi, Kevit

Greetings from Syncfusion support,

We suggest you use the below solution to overcome the reported issue. We have customized the data from the parameter so that we can get the customized data arguments. Please refer to the attached code snippet and sample for your reference.

public override async Task<object> InsertAsync(DataManager dataManager, object data, string key)

        {

           

            Order values = data as Order;

 

            values.OrderID = 123;

 

            values.Freight = 123;

 

            Orders.Add(data as Order);

 

            return data;

           

        }


Regards,
Prathap S


Attachment: BlazorDataGrid_551e8688.zip

Marked as answer
Loader.
Up arrow icon