private void new_ToolButton_Click(object sender, EventArgs e) { MobileDevice newDevice = new MobileDevice(); using (MobileDeviceEditForm dialog = new MobileDeviceEditForm(newDevice)) { if (dialog.ShowDialog(this) == DialogResult.OK) { RefreshItems(); } } }
private void edit_ToolButton_Click(object sender, EventArgs e) { if (radGrid_Devices.SelectedRows.Count == 1) { MobileDevice selectedDevice = GetFirstSelectedDataItem(); using (BusyCursor bc = new BusyCursor()) { using (MobileDeviceEditForm form = new MobileDeviceEditForm(selectedDevice.AssetId)) { if (form.ShowDialog() == DialogResult.OK) { RefreshItems(); } } } } }