private void button1_Click(object sender, EventArgs e) { string value1 = null; string value2 = null; string value3 = null; string value4 = null; string value5 = null; foreach (DataGridViewRow row in dataGridView1.SelectedRows) { value1 = row.Cells[0].Value.ToString(); value2 = row.Cells[1].Value.ToString(); value3 = row.Cells[2].Value.ToString(); value4 = row.Cells[3].Value.ToString(); if (row.Cells[4].Value != null) { value5 = row.Cells[4].Value.ToString(); } } string entry; if (value5 != null) { entry = value1 + "_" + value2 + "_" + value3 + "_" + value4 + "_" + value5; } else { entry = value1 + "_" + value2 + "_" + value3 + "_" + value4; } nmm.tables[nodeName].Remove(entry); nmm.sendClientTable(nodeName); fillTable(); }
private void button1_Click(object sender, EventArgs e) { string newEntry = textBox1.Text + "_" + textBox2.Text + "_" + textBox3.Text; nmm.tables[nodeName].Add(newEntry); nmm.sendClientTable(nodeName); fillTable(); }
private void button1_Click(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); sb.Append(textBox1.Text + "_" + textBox2.Text + "_" + textBox3.Text + "_" + textBox4.Text); if (textBox5.Text.Length > 0) { sb.Append("_" + textBox5.Text); } string newEntry = sb.ToString(); nmm.tables[nodeName].Add(newEntry); nmm.sendClientTable(nodeName); fillTable(); }