troubleshooting Question

C# MAX VALUE DATAGRIDVIEW ROW

Avatar of Lukas B
Lukas B asked on
C#
31 Comments3 Solutions834 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
Join our community to see this answer!
Unlock 3 Answers and 31 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 31 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros