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.
Unfortunately, activation email could not send to your email. Please try again.

Cell not refesh value after calculating when using tab instead enter

Thread ID:

Created:

Updated:

Platform:

Replies:

130257 May 2,2017 11:29 PM May 4,2017 12:30 AM Windows Forms 3
loading
Tags: GridGroupingControl
hieudt
Asked On May 2, 2017 11:29 PM

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 09:16 AM

 
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 3, 2017 10:02 PM

Hi,

It works, thank for your great help!

Mohanraj Gunasekaran [Syncfusion]
Replied On May 4, 2017 12:30 AM

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.

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.

;