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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Cell not refesh value after calculating when using tab instead enter

Thread ID:

Created:

Updated:

Platform:

Replies:

130257 May 3,2017 03:29 AM UTC May 4,2017 04:30 AM UTC WinForms 3
loading
Tags: GridGroupingControl
hieudt
Asked On May 3, 2017 03:29 AM UTC

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

Mohanraj Gunasekaran [Syncfusion]
Replied On 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 


hieudt
Replied On May 4, 2017 02:02 AM UTC

Hi,

It works, thank for your great help!

Mohanraj Gunasekaran [Syncfusion]
Replied On 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 


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.

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

;