private void dataGridView5_DoubleClick(object sender, EventArgs e) { try { fbLogowanie = new fblog(); fbLogowanie.fUsunUPRKodMag(textBox4.Text, textBox6.Text, dataGridView5.CurrentRow.Cells[0].Value.ToString()); try { textBox6.Text = dataGridView4.CurrentRow.Cells[0].Value.ToString(); fbLogowanie = new fblog(); List<string>[] lstDokumenty = fbLogowanie.fUPRKodDlaMAg(textBox4.Text, textBox6.Text); dataGridView5.Rows.Clear(); for (int i = 0; i < lstDokumenty[0].Count; i++) { int number = dataGridView5.Rows.Add(); dataGridView5.Rows[number].Cells[0].Value = lstDokumenty[0][i].ToString(); dataGridView5.Rows[number].Cells[1].Value = lstDokumenty[1][i].ToString(); dataGridView5.Rows[number].Cells[2].Value = lstDokumenty[2][i].ToString(); } } catch (NullReferenceException) { } } catch (NullReferenceException) { } }