Laploy Web Board
Would you like to react to this message? Create an account in a few clicks or log in to continue.

datagridviewer โช้ว์รูปที่ Picturebox

2 posters

Go down

datagridviewer โช้ว์รูปที่  Picturebox Empty datagridviewer โช้ว์รูปที่ Picturebox

ตั้งหัวข้อ  rungsak 5th February 2011, 3:27 pm

if (txtSearch.Text.Trim() == "")
{
MessageBox.Show("กรุณาระบุรหัสหรือชื่อก่อน !!! ", "ข้อผิดพลาด", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}

IHuman = from c in db.Humans
where c.IDCardName.Contains(txtSearch.Text.Trim())
|| c.FitstName.Contains(txtSearch.Text.Trim())
orderby c.FitstName
select c;

if (IHuman.Count() > 0)
{
tsEdit.Enabled = true;
dgvCustomerList.DataSource = IHuman.ToList();

}
else
{
ClearHuman();
dgvCustomerList.DataSource = null;
MessageBox.Show("เงื่อนไขที่คุณป้อน ไม่มีข้อมูลลูกค้า !!!", "ผลการค้นหา", MessageBoxButtons.OK, MessageBoxIcon.Information);
txtSearch.Focus();
txtSearch.SelectAll();
}
FormatDgvCustomerList();
}

private void FormatDgvCustomerList()
{
if (dgvCustomerList.RowCount > 0)
{
dgvCustomerList.Columns[0].HeaderText = "ระหัสบัตรประชาชน";
dgvCustomerList.Columns[1].HeaderText = "อำเภอ";

dgvCustomerList.Columns[0].Width = 180;

dgvCustomerList.Columns[1].Width = 235;

}
}
private void dgvCustomerList_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex == -1)
{
return;
}

mskIDCard.Text = dgvCustomerList.Rows[e.RowIndex].Cells["IDCardName"].Value.ToString();
txtAmphur.Text = dgvCustomerList.Rows[e.RowIndex].Cells["AmphurCard"].Value.ToString();

ทั้งหมด ส่วนนี้ ก็แสดงได้สำเร็จ แต่ ส่วนที่ติด จริงๆ คือ ใช่ช่อง รูปภาพ ผมต้องการให้ Doubleclick ที่DataGridview นั้น แล้วแสดงข้องมูลรูปภาพของพนักงานในแถวนั้น
ทำไม่ได้ครับ

picHumanPicture.image=????????.. .Rows.Item(e.RowIndex).Cells(Cool.Value ตรงนี้ ต้องเขียนอย่างไรครับ

ปล. ในSQL Database นะ ครับ

sql ImageNo รันตัวเลข auto คับ
IDCardNameImage ที่เก็บไฟล์รูปคับ
FileName ที่เก็บนามสกุลรูปคับ

picHumanPicture คือ Picturebox ครับ

rungsak

จำนวนข้อความ : 3
Join date : 05/02/2011

ขึ้นไปข้างบน Go down

datagridviewer โช้ว์รูปที่  Picturebox Empty ดูตัวอย่าง

ตั้งหัวข้อ  Admin 5th February 2011, 7:15 pm


Admin
Admin

จำนวนข้อความ : 215
Join date : 17/12/2009

http://laploy.forumotion.com

ขึ้นไปข้างบน Go down

ขึ้นไปข้างบน

- Similar topics

 
Permissions in this forum:
คุณไม่สามารถพิมพ์ตอบ