Click here to Skip to main content
15,908,112 members
Home / Discussions / C#
   

C#

 
QuestionAlt+N click method Pin
kailuaboy6-Feb-10 17:31
kailuaboy6-Feb-10 17:31 
QuestionBinary serialization Pin
hain6-Feb-10 17:10
hain6-Feb-10 17:10 
AnswerRe: Binary serialization Pin
harold aptroot6-Feb-10 23:39
harold aptroot6-Feb-10 23:39 
GeneralRe: Binary serialization Pin
OriginalGriff6-Feb-10 23:59
mveOriginalGriff6-Feb-10 23:59 
GeneralRe: Binary serialization Pin
harold aptroot7-Feb-10 0:13
harold aptroot7-Feb-10 0:13 
GeneralRe: Binary serialization Pin
hain7-Feb-10 4:02
hain7-Feb-10 4:02 
QuestionLabel Edit Bug with Treeview, MDI Container and MDIChildForms Pin
CrazyNinjaMike26-Feb-10 16:27
CrazyNinjaMike26-Feb-10 16:27 
QuestionGetting values to Add up from a datagrid text box Pin
miggs706-Feb-10 13:49
miggs706-Feb-10 13:49 
Ok my problem is I am using a data grid to collect a spacing from the user.
I am trying to get these values to add to each other.
I can get the first item to be placed in my program at 120", then then next item to be placed at 240".
So the second item will add to the first item.

My problem is anything after the first two items just keeps adding to the first instead of the over all total.
This is what I am looking for:
The Datagrid values are user input for example:
Row 1 120
Row 2 120
Row 3 120
(the rows will keep adding as long as the user has more to put in them.)

The first row of the datagrid defines an item at the 120" location.

Next I want to add the first row to the second row of the datagrid so the item will be at 240" location. ( It works up to here)

Next I want the value of row (1 and row 2) + the third row of the datagrid so the item will be at the 360" location.

I essentially want the value of the last row to add to the total of all of the previous rows.

Hope this all makes sense.
Thanks


for (int i = 0; i < d_Endpost.Rows.Count -1 ; i++)
{
///Sets Endpost Spacing


DataGridViewRow EndPostSpacing = d_Endpost.Rows[i];
Double xVal = 0;

foreach(DataGridViewRow row in d_Endpost.Rows)
{
string PostSpacing = EndPostSpacing.Cells["EPSpacing"].Value.ToString();
double PostSpacingTotal = I2M(double.Parse(PostSpacing.ToString()));
Double temp = PostSpacingTotal;
if (i == 0)
{
xVal = temp;
}
else
{
xVal = temp += PostSpacingTotal;
}

}
} 

AnswerRe: Getting values to Add up from a datagrid text box Pin
OriginalGriff6-Feb-10 21:42
mveOriginalGriff6-Feb-10 21:42 
GeneralMessage Removed Pin
7-Feb-10 3:12
miggs707-Feb-10 3:12 
GeneralRe: Getting values to Add up from a datagrid text box [modified] Pin
OriginalGriff7-Feb-10 4:33
mveOriginalGriff7-Feb-10 4:33 
GeneralRe: Getting values to Add up from a datagrid text box Pin
miggs707-Feb-10 5:04
miggs707-Feb-10 5:04 
GeneralRe: Getting values to Add up from a datagrid text box Pin
OriginalGriff7-Feb-10 5:12
mveOriginalGriff7-Feb-10 5:12 
GeneralRe: Getting values to Add up from a datagrid text box Pin
miggs707-Feb-10 6:10
miggs707-Feb-10 6:10 
GeneralRe: Getting values to Add up from a datagrid text box Pin
OriginalGriff7-Feb-10 8:17
mveOriginalGriff7-Feb-10 8:17 
GeneralMessage Removed Pin
7-Feb-10 11:13
miggs707-Feb-10 11:13 
GeneralRe: Getting values to Add up from a datagrid text box Pin
OriginalGriff7-Feb-10 22:31
mveOriginalGriff7-Feb-10 22:31 
GeneralMessage Removed Pin
8-Feb-10 1:48
miggs708-Feb-10 1:48 
GeneralRe: Getting values to Add up from a datagrid text box Pin
OriginalGriff8-Feb-10 2:05
mveOriginalGriff8-Feb-10 2:05 
Questionoverlapping area of n ractangles Pin
hotthoughtguy6-Feb-10 10:41
hotthoughtguy6-Feb-10 10:41 
Questionchange resource file dynamically Pin
jojoba20106-Feb-10 7:19
jojoba20106-Feb-10 7:19 
AnswerRe: change resource file dynamically Pin
Richard MacCutchan6-Feb-10 9:23
mveRichard MacCutchan6-Feb-10 9:23 
QuestionResource+C# Pin
jojoba20106-Feb-10 5:45
jojoba20106-Feb-10 5:45 
AnswerRe: Resource+C# Pin
Richard MacCutchan6-Feb-10 9:20
mveRichard MacCutchan6-Feb-10 9:20 
Questionproblem with winform visual style in c# Pin
evanxg6-Feb-10 4:53
evanxg6-Feb-10 4:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.