You are on page 1of 1

private void dgDosen_CellClick(object sender, DataGridViewCellEventArgs e)

{
DataGridViewRow row = this.dgDosen.Rows[e.RowIndex];
txtNIP.Text = row.Cells["NIP"].Value.ToString();
txtNamaDosen.Text = row.Cells["nama_dosen"].Value.ToString();
cmbAgama.Text = row.Cells["kode_agama"].Value.ToString();
dtLahir.Text = row.Cells["tgl_lahir_dosen"].Value.ToString();
if (row.Cells["sex"].Value.Equals("L"))
{
optPria.Checked = true;
}
else
{
optWanita.Checked = true;
}
}

You might also like