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

In "windows froms sfdatagrid", the value of "Table summary row" does not change in real time.

Thread ID:

Created:

Updated:

Platform:

Replies:

146175 Jul 24,2019 09:13 AM UTC Jul 29,2019 06:01 AM UTC WinForms 6
loading
Tags: SfDataGrid
Smart law developer
Asked On July 24, 2019 12:07 PM UTC

In "windows froms sfdatagrid", the value of "Table summary row" does not change in real time when updated item value.

"dgvEditReceipts.LiveDataUpdateMode = LiveDataUpdateMode.AllowSummaryUpdate" is not live updating;

sample source code: attached;



Attachment: SfDataGrid_summary_464b05f6.rar

Farjana Parveen Ayubb [Syncfusion]
Replied On July 25, 2019 06:49 AM UTC

Hi Smart, 
  
Thank you for using Syncfusion controls. 
  
We have analyzed your code, and you didn’t derive the ReceiptDetType class from INotifyPropertyChanged, so only the edited cell value is not reflected in TableSummaryRow. So you have to derive the class from INotifyPropertyChanged and you have to set the LiveDataUpdateMode.AllowDataShaping or LiveDataUpdateMode.AllowSummaryUpdate in SfDataGrid for TableSummary value update 
 
Please refer the below code example 
  
public class ReceiptDetType : INotifyPropertyChanged 
{ 
    private string feeAbstract; 
    { 
        get 
        { 
            return feeAbstract; 
        } 
        set 
        { 
            feeAbstract = value; 
            OnPropertyChanged("FeeAbstract"); 
        } 
 
    }  
 
    public event PropertyChangedEventHandler PropertyChanged; 
    private void OnPropertyChanged(string propertyName) 
    { 
        if (PropertyChanged != null) 
            this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); 
    } 
 
} 
  
  
Please let us know, if you require further assistance on this. 
  
Regards, 
Farjana Parveen A 


Smart law developer
Replied On July 25, 2019 07:56 AM UTC

thank you.

Smart law developer
Replied On July 25, 2019 08:24 AM UTC

The example solved the problem.
In the example result, let me know how I would like to get the Text value of the Summary row column;
In SfDataGrid1_CurrentCellValidated (...); my code :                 int nFeeTotal = 0x0;
                int nTaxTotal = 0x0;
                foreach (ReceiptDetType item in _ReceiptTypesList)
                {
                    nFeeTotal += item.FeePrice;
                    nTaxTotal += item.TaxPrice;
                } Please let me know if there is a simpler method;

Farjana Parveen Ayubb [Syncfusion]
Replied On July 26, 2019 09:53 AM UTC

Hi Smart, 
 
Thank you for your update. 

We have analyzed your query, we can able get the text value of the summary row by using SummaryCreator helper method. Please refer the below code example
 
 
void dgvEditReceipts_CurrentCellValidated(object sender, Syncfusion.WinForms.DataGrid.Events.CurrentCellValidatedEventArgs e) 
{ 
    var feePriceSV = SummaryCreator.GetSummaryDisplayText(dgvEditReceipts.View.Records.TableSummaries[0], "FeePrice", dgvEditReceipts.View); 
    var taxPriceSV = SummaryCreator.GetSummaryDisplayText(dgvEditReceipts.View.Records.TableSummaries[0], "TaxPrice", dgvEditReceipts.View); 
} 
 
 
Regards, 
Farjana Parveen A  


Smart law developer
Replied On July 26, 2019 05:04 PM UTC

Thank you.

Farjana Parveen Ayubb [Syncfusion]
Replied On July 29, 2019 06:01 AM UTC

Hi Smart, 
 
Thanks for the update. 
 
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you. 
 
Regards, 
Farjana Parveen A 


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