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

Image overlays

1 Answer 115 Views
ListView
This is a migrated thread and some comments may be shown as answers.
tom
Top achievements
Rank 1
tom asked on 12 Aug 2011, 07:12 PM
Has anybody an idea, how to paint image overlays over the listitems? One solution could be to create the item image dynamically, but I am looking for a better solution (less resource usage and faster processing). The grid view has the rowpaint event, but I don't find such a event for the list view.

1 Answer, 1 is accepted

Sort by
0
Accepted
Jack
Telerik team
answered on 17 Aug 2011, 08:25 AM
Hi Tom,

It is easy to draw an overlayed image in list view elements. You just have to handle the VisualItemFormatting event and set the TextImageRelation property to Overlay. Here is a sample:
void view_VisualItemFormatting(object sender, ListViewVisualItemEventArgs e)
{
    e.VisualItem.Image = Resources.file;
    e.VisualItem.ImageAlignment = ContentAlignment.MiddleCenter;
    e.VisualItem.TextImageRelation = TextImageRelation.Overlay;
}

I hope this helps. If you have any further questions, I will be glad to help.

Best wishes,
Jack
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
ListView
Asked by
tom
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or