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
close icon

Cell not refesh value after calculating when using tab instead enter

Hi,

I have 3 columns (Quantity, Price, Amount), in event TableControlCurrentCellEditingComplete, I wrote a formula to calculate Amount = Quantity * Price and SUM value to another textbox. When using enter to navigate throught cells, cell "Amount" display right value, but when using tab, it's not althought sum value still right.

I have attached a sample, please help me. Thanks.

Attachment: DateTimePickerAdv_a9961e97.rar

3 Replies

MG Mohanraj Gunasekaran Syncfusion Team May 3, 2017 01:16 PM UTC

 
Thanks for using Syncfusion product. 
 
Query 
Solution 
When using enter to navigate throught cells, cell "Amount" display right value, but when using tab, it's not althought sum value still right. 
Solution 1 
 
By default, the GridGroupingControl update the value based on the underlying datasource when press the enter key. If you want to update the calculated value in grid while pressing the tabkey, you can use the EndEdit method in TableControlCurrentCellKeyDown event. Please refer to the below code example, 
 
Code example 
 
if (e.Inner.KeyCode == Keys.Tab) 
    gridGroupingControl1.Table.CurrentRecordManager.EndEdit(); 
 
Solution 2 
 
Also, you can achieve your scenario by using the Table.Reload and DataTable.AcceptChanges method. Please refer to the below code example, 
 
Code example 
Data.Product.AcceptChanges(); 
this.gridGroupingControl1.Table.Reload(); 
 
 
Sample link: GridGroupingControl 
 
Regards, 
Mohanraj G 




MG Mohanraj Gunasekaran Syncfusion Team May 4, 2017 04:30 AM UTC

Hi Hieudt, 

Thanks for your update. 

We are glad to know that your reported problem has resolved. Please let us know, if you have any further assistance. 

Regards, 
Mohanraj G 


Loader.
Live Chat Icon For mobile
Up arrow icon