I've spent hours on this and have tried many ways. For the life of me I cannot make a GridView display any image.
I have a class called Employee. I then have a List<Employee> which is bound to the GridView ItemsSource. All bindings are working just fine. The first column in the grid is a GridViewImageColumn. I have never had it display an image. I've set my Employee.Photo property to be a Bitmap, and Image, a BitmapImage, and I've used System.Windows.Drawing as well as System.Windows.Controls, and System.Media.Imaging (I think that was the 3rd one).
When loading the image for the employee, here's the latest code I've tried:
What can possibly be wrong? The Image on the form loads the picture just fine. The grid never does.
I have a class called Employee. I then have a List<Employee> which is bound to the GridView ItemsSource. All bindings are working just fine. The first column in the grid is a GridViewImageColumn. I have never had it display an image. I've set my Employee.Photo property to be a Bitmap, and Image, a BitmapImage, and I've used System.Windows.Drawing as well as System.Windows.Controls, and System.Media.Imaging (I think that was the 3rd one).
When loading the image for the employee, here's the latest code I've tried:
BitmapImage bmp = new BitmapImage();
bmp.BeginInit();
bmp.UriSource = new Uri(@"FULL PATH TO THE FILE", UriKind.Absolute);
bmp.EndInit(); Employee.Picture.Source = bmp; SomeImageOnTheForm.Source = bmp; // To test the successful load.
What can possibly be wrong? The Image on the form loads the picture just fine. The grid never does.