c# 2005 Datagrid

Posted on 2006-05-23
Last Modified: 2010-04-16
Trying to loop through the selected rows in a datagrid, showing the 1st field if each row of it....

I tried Currencymanager, but no luck.....

any ideas...

Question by:bman9111
    LVL 11

    Accepted Solution

    Is DataGridView OK?  Youy can get the indices of the selected rows like this:

            private void button1_Click(object sender, EventArgs e)
                foreach (DataGridViewRow dgvr in dataGridView1.SelectedRows)

    Then, use those indices against the DataSource.

    LVL 6

    Assisted Solution

    private void button1_Click(object sender, EventArgs e)
                foreach (DataGridViewRow dgvr in dataGridView1.SelectedRows)

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
    Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    732 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

    19 Experts available now in Live!

    Get 1:1 Help Now