Nguyễn Đức Cường • 18 ngày trước
if (e.RowIndex >= 0)
{
var selectedRow = dgvStudent.Rows[e.RowIndex];
string studentID = selectedRow.Cells[0].Value?.ToString();
if (!string.IsNullOrEmpty(studentID))
{
var student = studentService.FindById(studentID);
if (student != null)
{
ShowAvatar(student.Avatar);
}
else
{
picAvatar.Image = null;
}
}
Bình luận: