Grid View Data Fetch in to TextBoxes using windows applicati
I want to fetch the data into grid view to textboxes using in windows application .but not possible to do that things i search in so many websites but i cant find that the particular solution of my problem all solutions depending on the webapplication oriented if you have any idea tell me immediately
Sanjeeb LenkaPosted Sep 2, 2013, 2:34 AM
try like this:
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
//Get the selected row from user
DataGridViewRow SelectedRow = dataGridView1.Rows[e.RowIndex];
//Get the value at the cells in the Row
string Username = SelectedRow.Cells["Username"].Value.ToString();
string Password = SelectedRow.Cells["Password"].Value.ToString();
//Set the value to the text box
txtUsername.Text = Username;
txtPwd.Text = Password;
}
Nitesh KejriwalPosted Sep 2, 2013, 2:30 AM