Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

C# MAX VALUE DATAGRIDVIEW ROW

Avatar of Lukas B
Lukas B asked on
C#
31 Comments1 Solution834 ViewsLast Modified:
Hello,

how to find max value in datagridview (in row)

Thanks in advance!

My code:

public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            double x = 0;
            double y = 0;
            int index1 = 0;
            int a = 0;
            double[] array = new double[12];

            while (x <= 2)
            {
                index1 = 0;
                y = 0;
                while (y <= 2)
                {
                    array[index1] = Math.Cos(x) + Math.Sin(y);
                    y = y + 0.2;
                    index1++;
                }
    
                    dataGridView1.Rows.Add(array[0], array[1], array[2], array[3], array[4], array[5], array[6], array[7], array[8], array[9], array[10], array[11]);
                    dataGridView1.Rows[a].HeaderCell.Value = Convert.ToString(x);
                    a++;

                    x = x + 0.2;
            }

        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            
        }
}
table.JPG
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Commented:
This problem has been solved!
Unlock 1 Answer and 31 Comments.
See Answers