mouse click event on row in Data Grid in C#
How to handle mouse click on a row in Datagrid in C#
for eg if i m populating a table from my database in a data grid and when i select a row .i should be able to go to a different page and display the contents of that row in text开发者_StackOverflow中文版 boxes .is it possible to do that in c#
You can handle SelectionChanged
event of DataGridView and use DataGridView1.SelectedRows
collection to get reference of selected row(s).
if(DataGridView1.SelectedRows.Count!=0)
{
str = DataGridView1.SelectedRows[0].Cells[0].Value;
}
精彩评论