How to put an items text underneath the image?

2 posts, 1 answers
  1. Glen
    Glen avatar
    1 posts
    Member since:
    Jul 2013

    Posted 15 Jul 2013 Link to this post

    I was wondering how an images text could be put underneath the image (its currently in a horizontal orientation).  The code I have below is not doing the trick and I was hoping you could help on this, should be a quick solution.  Thank you for your time.

    private void addEmptyImages()
            {
                for (int i = 0; i < imagelistPictures.Images.Count; i++)
                {
                    if (imagelistPictures.Images[i] != null)
                    {
                        ListViewDataItem item = new ListViewDataItem();
                        item.Tag = "Delay Render";
                        item.Text = "Page " + (i + 1).ToString();
                        item.Image = Properties.Resources.imageLoading;
                        item.ImageAlignment = ContentAlignment.MiddleCenter;
                        item.TextAlignment = ContentAlignment.TopLeft;
                        listviewGotoPage.Items.Add(item);
                    }
                    else
                    {
                        MessageBox.Show("contents of initial list are null, break");
                        break;
                    }
                     
                }
            }
  2. Answer
    Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 18 Jul 2013 Link to this post

    Hi Glen,

    Thank you for writing.

    There is a special property to control the relation between the text and the image - TextImageRelation:
    radListView1.Items[0].TextImageRelation = TextImageRelation.Overlay;

    I hope that you find this information useful.

    Regards,
    Stefan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top