• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

Datagrid Value Read & Playback

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:
messagebox.show( 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.
1 Solution
ProWebNetworksAuthor Commented:
Found it :)
            int SelRow = Convert.ToInt32( dgActiveUsers.SelectedCells[0].RowIndex.ToString());

Open in new window


Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now