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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set one cell value based on the other cell value in grid JS2 mvc or js

Thread ID:

Created:

Updated:

Platform:

Replies:

144466 May 7,2019 09:12 PM UTC May 8,2019 10:52 AM UTC ASP.NET MVC - EJ 2 1
loading
Tags: Grid
luis
Asked On May 7, 2019 09:12 PM UTC

How to set one cell value based on the other cell value in grid JS2 MVC or JS2?

Pavithra Subramaniyam [Syncfusion]
Replied On May 8, 2019 10:52 AM UTC

 
Thanks for contacting Syncfusion support. 
 
We have analyzed your requirement. We suspect that you would like to update a column value(for example “Total” column) based on other column values while performing editing in Grid. We have achieved this requirement by using the “ActionBegin” event of Grid. In the “ActionBegin” handler, based on the “requestType” as “save”, we have updated the “args.data.Total” value. Please refer the cod example below, 
 
 
<div> 
    @Html.EJS().Grid("Grid")...ActionBegin("ActionBegin")...Render() 
</div> 
 
<script type="text/javascript"> 
    function ActionBegin(args) { 
        if (args.requestType == "save") { 
            args.data.Total = document.getElementsByName("OrderID")[0].value * document.getElementsByName("EmployeeID")[0].value;  //Update "Total" column based on OrderID and EmployeeID values 
        } 
    } 
</script> 
 
 
We are also attaching the sample for your convenience, please download the sample from the link below, 
 
Please get back to us if you need further assistance. 
 
Regards, 
Pavithra S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon