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
Rashid Khan
NA
159
0
how to show images in datagirdview form imagefolder?
Oct 9 2013 7:37 AM
I m trying to bind datagridview from images which are stores in imagefolder dynamically.
i have try this
System.IO.DirectoryInfo inputDir = new System.IO.DirectoryInfo("ImageFolder Path which are in my application");
try
{
if ((inputDir.Exists))
{
System.IO.FileInfo file = null;
foreach (System.IO.FileInfo eachfile in inputDir.GetFiles())
{
file = eachfile;
if (file.Extension.ToLower() == ".jpg")
{
DataGridViewImageColumn imageColumn = new DataGridViewImageColumn();
imageColumn.Name = "ImageColumn";
imageColumn.HeaderText = "An Image!";
var imagepath = file.FullName;
Image image = System.Drawing.Image.FromFile(file.FullName);
imageColumn.Image = image;
dataGridView1.Columns.Insert(0, imageColumn);
}
i++;
}
on designer side. I places datagridview (empty).
in out put only columns header show . not a single image load.
please tell me how to show images in datagridview.
Reply
Answers (
1
)
Autocomplete textbox in Mdi child form c#
printing data