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

How to put an items text underneath the image?

1 Answer 129 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Glen
Top achievements
Rank 1
Glen asked on 15 Jul 2013, 10:30 PM
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;
                }
                 
            }
        }

1 Answer, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 18 Jul 2013, 02:17 PM
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 >>
Tags
ListView
Asked by
Glen
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or