private void btnTambah_Click(object sender, RoutedEventArgs e) { FormSatuan formSatuan = new FormSatuan(); formSatuan.ShowDialog(); RefreshDataGrid(); }
private void btnEdit_Click(object sender, RoutedEventArgs e) { try { DataRowView dataRowView = (DataRowView)((Button)e.Source).DataContext; FormSatuan formSatuan = new FormSatuan("Edit", Convert.ToInt32(dataRowView[1].ToString())); formSatuan.txtSatuan.Text = dataRowView[2].ToString(); formSatuan.txtKeterangan.Text = dataRowView[3].ToString(); formSatuan.ShowDialog(); RefreshDataGrid(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }