Goran Bibic

Goran Bibic

  • 696
  • 2.3k
  • 62.1k

Datagrid selection changed for image?

Apr 6 2018 4:16 AM
Problem is selection cahnged for images in datagrid...
 
  1. private void roba_uslugeDataGridView_SelectionChanged(object sender, EventArgs e)  
  2.         {  
  3.             if (roba_uslugeDataGridView.SelectedRows.Count > 0)   
  4.             {  
  5.   
  6.                 string id = roba_uslugeDataGridView.SelectedRows[0].Cells[0].Value.ToString();  
  7.                 string sifra = roba_uslugeDataGridView.SelectedRows[0].Cells[1].Value.ToString();  
  8.                 string naziv = roba_uslugeDataGridView.SelectedRows[0].Cells[2].Value.ToString();  
  9.                 dataPictureBox.Image = null;  
  10.                 idTextBox.Text = id;  
  11.                 sifraTextBox.Text = sifra;  
  12.                 imeTextBox.Text = naziv;  
  13.                  
  14.                 byte[] img_arr = null;  
  15.                 MemoryStream ms = new MemoryStream();  
  16.                 dataPictureBox.Image.Save(ms, dataPictureBox.Image.RawFormat);  
  17.                 img_arr = ms.GetBuffer();  
  18.             }  
  19.         } 
 

Brought to you by:

Answers (11)