Goran Bibic

Goran Bibic

  • 480
  • 2.9k
  • 195.8k

Show data in another form quick and easy

Mar 23 2018 1:58 PM
What is wrong?  Error is every time only first column show
 
  1. private void poreziDataGridView_Click(object sender, EventArgs e)  
  2.        {  
  3.              
  4.                DataGridViewRow CurrentRow = poreziDataGridView.SelectedRows[0];  
  5.                Form2 f1 = new Form2();  
  6.   
  7.           f1.idTextBox.Text = poreziDataGridView.CurrentRow.Cells["dataGridViewTextBoxColumn1"].Value.ToString();  
  8.           f1.imeTextBox.Text = poreziDataGridView.CurrentRow.Cells["dataGridViewTextBoxColumn2"].Value.ToString();  
  9.           f1.procenatTextBox.Text = poreziDataGridView.CurrentRow.Cells["dataGridViewTextBoxColumn3"].Value.ToString();  
  10.           f1.fiksna_vrednostTextBox.Text = poreziDataGridView.CurrentRow.Cells["dataGridViewTextBoxColumn4"].Value.ToString();  
  11.           f1.redni_brojTextBox.Text = poreziDataGridView.CurrentRow.Cells["dataGridViewTextBoxColumn5"].Value.ToString();  
  12.   
  13.           f1.ShowDialog();  
  14.              
  15.        } 
 

Answers (1)