Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hello i m rohit ...
i am devoloping windows application in C# i want , when i will be click on dataGridView cell the record in the cell of dataGridView will be show on the textbox control of the windows form so that i will have problem ....
please tell me how to do this task ....
Reply i am waiting.....
Posted
Comments
Groulien 31-May-11 4:48am    
I don't understand the question.
What 'task' are you talking about?
demouser743 31-May-11 4:53am    
You want to display the cell value to text box or what

1 solution

Handle the DataGridView SelectionChanged event:
private void myDataGridView_SelectionChanged(object sender, EventArgs e)
    {
    if (myDataGridView.SelectedCells.Count > 0)
        {
        myTextBoxToHoldTheData.Text = myDataGridView.SelectedCells[0].Value.ToString();
        }
    }
 
Share this answer
 

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