populate DataGridView column with int array

Posted on 2006-04-05
Last Modified: 2012-05-05
Hi experts,
How can i copy int array as a new column into dataGridView already binding to database?
Question by:skydancer11
    LVL 6

    Accepted Solution

    Here is an example:

                boundDataGridView.Columns.Add("IntColumn", "IntColumn");
                int[] intArray = { 1, 2, 3, 4, 5, 6, 7 };
                foreach (DataGridViewRow row in boundDataGridView.Rows)
                    if (row.Index >= intArray.Length) break;
                    row.Cells["IntColumn"].Value = intArray[row.Index];

    Author Comment

    Thank's e1v

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now