Click here to Skip to main content
16,012,198 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
Hi,

I calculated cumulative frequency like this:
a b c
1 2 2
1 3 5
1 6 11
2 4 4
2 1 5

C#
for (int rowIndex = gdv2.Rows.Count - 2; rowIndex > 0; rowIndex--)
            {
                GridViewRow previousRow = gdv2.Rows[rowIndex + 1];
                int c1 = 0;
                int cv1 = 0;
                foreach (GridViewRow row1 in gdv2.Rows)
                {
                    if (row1.Cells[1].Text == previousRow.Cells[1].Text)
                    {
                        cv1 =System.Convert.ToInt32 (row1.Cells[3].Text);
                        c1 += cv1;
                        row1.Cells[4].Text = c1.ToString();
                    }
                }
                dataArray1.Add(c1);
            }


I need to store the values such as 11,5 in data array, but by using this code it store the values more times.

Can any one say me the suggestion for storing unique answer(value) in data array?
Posted

1 solution

Now I KNOW you asked this one a few days ago!
calculating multiple cumulative frequency in gridview[^]
If no one answered then, (or referred to your earlier questions on the same subject) perhaps you should take the hint?
 
Share this answer
 
Comments
gowdhami 25-Feb-11 3:59am    
actually that post was in deleted status. so i cant update that... so only i post this.. the answer given for that is not correct
gowdhami 25-Feb-11 4:02am    
for me that post was showing as deleted status... and that answer is suitable for calculating single cf... but i wrote coding for multiple cf.. but the answer was storing many times in data array... my question is how to store the all cf value only once
OriginalGriff 25-Feb-11 4:03am    
That turns out not to be the case: I just checked and neither of those posts are deleted.
gowdhami 25-Feb-11 4:06am    
actually i found answer for that... that coding only i wrote in my question... now i am asking different question
Espen Harlinn 25-Feb-11 10:50am    
Nice reply - seems like it's been posted several times :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900