TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
39
11.3k
Show image in picture box clicked from datagridview
Feb 5 2018 3:17 AM
I want to show image in picture box from database clicked in datagridview.
Here is my code:
private
void
dataGridView1_CellClick(
object
sender, DataGridViewCellEventArgs e)
{
if
(e.RowIndex >= 0)
{
DataGridViewRow row =
this
.dataGridView1.Rows[e.RowIndex];
txtEmpID.Text = row.Cells[0].Value.ToString();
txtDeleteAndSearch.Text = row.Cells[0].Value.ToString();
txtEmpName.Text = row.Cells[1].Value.ToString();
dateTimePicker1.Text = row.Cells[2].Value.ToString();
if
(row.Cells[3].Value.ToString() ==
"Male"
)
{
radioMale.Checked =
true
;
}
else
{
radioFemale.Checked =
true
;
}
txtEmail.Text = row.Cells[4].Value.ToString();
txtMSalary.Text = row.Cells[5].Value.ToString();
txtAddr.Text = row.Cells[6].Value.ToString();
txtMob.Text = row.Cells[8].Value.ToString();
pictureBoxEmpPic.Image =row.Cells[9].Value
as
Image;
txtPass.Text = row.Cells[10].Value.ToString();
txtPassConf.Text = txtPass.Text;
}
}
every thing is OK, but image not showing in picturebox,
(pictureBoxEmpPic.Image =row.Cells[9].Value as Image; is not working)
Anybody help me?
Reply
Answers (
7
)
validation in c#
How to show image on DataGridView?