gridview的累积频率答案 [英] cummulative frequency answer from gridview

查看:75
本文介绍了gridview的累积频率答案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我这样计算出累积频率:
a b c
1 2 2
1 3 5
1 6 11
2 4 4
2 1 5

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

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);
            }



我需要将11,5之类的值存储在数据数组中,但是通过使用此代码,它可以存储更多次这些值.



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?

推荐答案

现在我知道您几天前问过这个问题了吗?
在gridview中计算多个累积频率 [
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?


这篇关于gridview的累积频率答案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆