hi all,
i would like to get the selected row from the datagrid and get the row's data to transfer it to textboxes.. how can i do this?
By passing integer index to the Rows collection you can select a row. A row is made up of Cells collection.
TextBox1.Text=GridView1.Rows[0].Cells[0].Text;
U should over ride datagrid_selectedindexchanged method
in which get selectrow by something like following:
DataGrid.Rows[e.selectedindex].Cells[n].Text;
where n could be ur column number in a row as u know which column value u want to retrieve.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.