<\/span><\/h2>\n\n\n\n private void button8_Click(object sender, EventArgs e)\n {\n \/\/Check if there is atleast one row selected\n if (dataGridView1.SelectedRows.Count > 0 && dataGridView1.SelectedRows != null)\n {\n \/\/Check If More Than One Row Is Selected\n if (dataGridView1.SelectedRows.Count > 1)\n {\n MessageBox.Show("Multiple Rows Selected. Please Select One row only");\n }\n else if (dataGridView1.SelectedRows.Count == 1)\n {\n DataGridViewRow selectedDatagridViewRow = dataGridView1.SelectedRows[0]; \n \/\/Display Another Form On Button Click\n ViewSelectedDatagridviewRow showNewFormOnButtonClick = new ViewSelectedDatagridviewRow();\n showNewFormOnButtonClick.txtBoxFirstName.Text = selectedDatagridViewRow.Cells[0].Value.ToString();\n showNewFormOnButtonClick.txtBoxLastName.Text = selectedDatagridViewRow.Cells[1].Value.ToString();\n showNewFormOnButtonClick.txtBoxGender.Text = selectedDatagridViewRow.Cells[2].Value.ToString();\n showNewFormOnButtonClick.txtBoxCountry.Text = selectedDatagridViewRow.Cells[3].Value.ToString();\n showNewFormOnButtonClick.txtBoxImagePath.Text = selectedDatagridViewRow.Cells[4].Value.ToString();\n \n \/\/Start the form In the center screen\n \/\/showNewFormOnButtonClick.StartPosition = FormStartPosition.CenterScreen;\n showNewFormOnButtonClick.ShowDialog();\n \/\/MessageBox.Show("One row selected");\n }\n }\n else\n {\n MessageBox.Show("No Row Selected");\n }\n }\n<\/pre>\n","protected":false},"excerpt":{"rendered":"How To Show DataGridView Selected Row Data In Another Form On Button Click In C# Windows Forms Application This tutorial shows How To Show DataGridView…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/posts\/1780"}],"collection":[{"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/comments?post=1780"}],"version-history":[{"count":0,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/posts\/1780\/revisions"}],"wp:attachment":[{"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/media?parent=1780"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/categories?post=1780"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/tags?post=1780"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}