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

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

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

6 Replies

FP Farjana Parveen Ayubb Syncfusion Team 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 



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

thank you.


SL Smart law developer 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;


FP Farjana Parveen Ayubb Syncfusion Team 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  



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

Thank you.


FP Farjana Parveen Ayubb Syncfusion Team 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 


Loader.
Live Chat Icon For mobile
Up arrow icon