Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
25
Trying to load images into a UltraListVIew from a dataset
posted

I have a dataset that returns an ImageKey, ImageDescription and the binary image.  I am trying to load them as thumbnails into a UltraListView.  I have the View property of the UltraListView set to thumbnails.  When I run the code I get the listview with the generic bitmap for each entry and System.byte[] below each generic image.  I can not figure out why the images in the database are not showing up.  I know they are valid images.  Any help is very much appreciated in advance.

Thanks

private void LoadThumbNails()
{
     string strKeyVal = "";
     Infragistics.Win.UltraWinListView.
UltraListViewItem i = new Infragistics.Win.UltraWinListView.UltraListViewItem();
     foreach (DataRow r in dsImages.Tables[0].Rows)
     {
          strKeyVal = r[
"ImageKey"].ToString().Trim() + "-" + r["ImageDesc"].ToString().Trim();
          try
         
{
              
object m_MyImage = (byte[])r["BinaryImage"];
               ulvThumbnails.Items.Add(strKeyVal,m_MyImage);
          }
         
catch (Exception e)
          {

          }
     }
}