This is a migrated thread and some comments may be shown as answers.

listcontrol only shows part of item image

1 Answer 74 Views
ListControl
This is a migrated thread and some comments may be shown as answers.
Bab
Top achievements
Rank 1
Bab asked on 04 Aug 2012, 09:44 AM
Hi.

I am filling a listcontrol by using the following code :

public static List<RadListDataItem> GetItems()
        {
            List<RadListDataItem> items = new List<RadListDataItem>();
 
 
            for (int i = 1; i <= 10; i++)
            {
                RadListDataItem toadd = new RadListDataItem();
                toadd.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
                toadd.Text = "sssssssssss";
                //toadd.Image.
                string imagename = "MyProject.SuIcons.d" + i + ".JPG";
                toadd.Image = new Bitmap(Assembly.GetExecutingAssembly().
                    GetManifestResourceStream(imagename));
                items.Add(toadd);
            }
            return items;
         
        }


but, only top portition of every item image is show in listcontrol, I mean I cant see the whole image associated with item in the list.

Would you help me please ?

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 09 Aug 2012, 06:09 AM
Hi Bab,

In order to size the items according to their content, you should use the AutoSizeItems functionality of RadListControl Simply set the property to true and your items will be sized accordingly: 
radListControl1.AutoSizeItems = true;

I hope this helps. 

All the best,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
ListControl
Asked by
Bab
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or