private void AddToolStripButton_Click(object sender, EventArgs e) { IpAddressesEditForm iaef = new IpAddressesEditForm(); // After Add New record , this form need refresh iaef.NewSaved += this.EditNewSaved; iaef.MdiParent = this.MdiParent; iaef.Show(); }
private void modifyToolStripButton_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 0) { // get the selected row DataGridViewRow myRow = dataGridView1.SelectedRows[0]; // get row id string sId = myRow.Cells["id"].Value.ToString(); //find the row from Tik4Net object list foreach (Tik4Net.Objects.Ip.IpAddress ipAddress in IpAddresses) { //find the address object if (ipAddress.Id.Equals(sId)) { IpAddressesEditForm iaef = new IpAddressesEditForm(ipAddress, IpAddresses); iaef.MdiParent = this.MdiParent; iaef.Show(); } } } }