Datagrid Value Read & Playback

Posted on 2009-04-21
Last Modified: 2013-12-17
Hey guys, this is a windows application built in C#. I am using the datagrid tool and populating it with employee information. The grid ends up with 5 columns and a variable amount of rows.

I want to select a row of data in the grid, then click a button on the form and have it: cell content of the first cell/column in the selected row )  

The first column is actually the UserID, and I want to be able to retrieve that ID for pushing the info into another stored procedure.
Question by:ProWebNetworks
    1 Comment
    LVL 1

    Accepted Solution

    Found it :)
                int SelRow = Convert.ToInt32( dgActiveUsers.SelectedCells[0].RowIndex.ToString());

    Open in new window


    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

    IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    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…

    733 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

    17 Experts available now in Live!

    Get 1:1 Help Now