How to set incremental value in grid

I have an sfgrid control in blazer application.I have an column in grid called as "Version".I would like to know  how to set incremental version number in version column of grid.

For example 
 
Ongrid initialize the version should be 1 and If I create new row after enter key navigation On last column of grid then the version should be increment.

1 Reply 1 reply marked as answer

RS Renjith Singh Rajendran Syncfusion Team June 2, 2021 10:09 AM UTC

Hi Ismail, 

Greetings from Syncfusion support. 

We suspect that you would like to update the Version column value when saving a row by using enter key press. If so, then we suggest you to increment the Version column value using OnActionBegin event of Grid based on RequestType as Save. Please refer and use the codes below, 

<GridEvents OnActionBegin="OnActionBegin" TValue="Order"></GridEvents>
 
public void OnActionBegin(ActionEventArgs<Order> args) 
{ 
    if (args.RequestType.Equals(Action.Save)) 
    { 
        args.Data.Version = args.Data.Version + 1; 
    } 
} 



Please refer the above attached sample and if we have misunderstood your requirement, then the following details would be helpful for us to proceed further. 

  1. Share with us a video demo explaining the requirement.
  2. Share the detailed explanation of your complete requirement.
  3. Share the mode of editing you are using in grid.

The provided information will help us analyze the problem, and provide you a solution as early as possible. 

Regards, 
Renjith R 


Marked as answer
Loader.
Up arrow icon