Listview with imagelist, adding pics from db
Hi,
I am trying to add images to a Listview but they are not visible...
DB.Connect();
DB.Open ();
DB.Execute_Sql_Read ("Select * from C");
company.View = View.Details;
company.SmallImageList =imglist;
company.Columns.Add("C", 100, HorizontalAlignment.Left);
company.Columns.Add("E", 100, HorizontalAlignment.Left);
company.Columns.Add("W", 100, HorizontalAlignment.Left);
company.Columns.Add("B", 100, HorizontalAlignment.Left);
company.Columns.Add("H", 100,HorizontalAlignment.Left);
company.Columns.Add("O", 100,HorizontalAlignment.Left);
company.Columns.Add("",0,HorizontalAlignment.Left);
ListViewItem lSingleItem;
while (DB.Read_Next())
{
imglist.Images.Add (Bitmap.FromFile (DB.Get_Data ("string",7)));
lSingleItem = company.Items.Add(DB.Get_Data ("string",1));
lSingleItem.SubItems.Add(DB.Get_Data ("string",2));
lSingleItem.SubItems.Add(DB.Get_Data ("string",3));
lSingleItem.SubItems.Add(DB.Get_Data ("string",4));
lSingleItem.SubItems.Add(DB.Get_Data ("string",5));
lSingleItem.SubItems.Add(DB.Get_Data ("string",6));
lSingleItem.SubItems.Add(DB.Get_Data ("integer",0));
}
DB.Close ();
Anyone who know how I can make them visible?
Thx
I tried putting the line
company.SmallImageList =imglist;
at the and but doesnt work, LargeImageList doesnt work...the files are retrieved from the database I checked that, that works. The pictures are also on the harddrive so.. but still not visible , it works when I add images to the list in the designer window, but then its not dynamicaly...
Anyone?