Click here to Skip to main content
15,894,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi guyz

how can i select a row in gridview without an extra field or using select button
thanks guys, thanks in advance
Posted
Comments
Suresh Suthar 9-Aug-11 2:37am    
I think you can use CellEnter and RowEnter events.

1 solution

Use this
C#
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
             fsttxt.Text = dataGridView1.SelectedCells[0].Value.ToString();
            lsttxt.Text = dataGridView1.SelectedCells[1].Value.ToString();
            usertxt.Text = dataGridView1.SelectedCells[2].Value.ToString();
            passtxt.Text = dataGridView1.SelectedCells[3].Value.ToString();
        }
 
Share this answer
 
v2
Comments
Member 8092191 9-Aug-11 22:42pm    
sir im asking about gridview in asp.net

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900