listcontrol only shows part of item image

2 posts, 0 answers
  1. Bab
    Bab avatar
    1 posts
    Member since:
    Aug 2012

    Posted 04 Aug 2012 Link to this post

    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 ?
  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 09 Aug 2012 Link to this post

    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 >>
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top