Click here to Skip to main content
14,668,067 members
Rate this:
Please Sign up or sign in to vote.
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.....
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

Rate this:
Please Sign up or sign in to vote.

Solution 1

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();

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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100