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

segment of KB summary row code

Thread ID:





15973 Jul 1,2004 03:30 PM UTC Jul 1,2004 03:38 PM UTC WinForms 1
Tags: GridControl
Clario Menezes
Asked On July 1, 2004 03:30 PM UTC

Referring to the code available at... http://www.syncfusion.com/Support/article.aspx?id=10398 ... there is a segment of the code which sums up the values in a column (sorry if the formatting doesn''t come out nice): for(int row = 1; row <= this.grid.Model.RowCount; ++row) { string s = (row == e.RowIndex) ? e.Style.Text : this.grid.Model[row, e.ColIndex].Text; d += double.Parse((s.Length > 0) ? s : "0"); } My question is: is it necessary to perform the conditional check in the for loop? I''d have thought it would always be sufficient to say: s = this.grid.Model[row, e.ColIndex].Text; and then set d. Please tell me if I am missing something. Thanks in advance.

Administrator [Syncfusion]
Replied On July 1, 2004 03:38 PM UTC

This code is from SaveCellInfo. If the particular (e.RowIndex, e.ColIndex) cell is actively being edited at the point this code is hit, the e.Style.Text would have the new value of the cell, and grid.Model[row, e.ColIndex].Text would have the old (not updated value). This is because the value will not have been moved from the e.Style to the grid until SaveCellInfo has completed.


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