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

Alternate height for rows

1 Answer 71 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Manuel
Top achievements
Rank 1
Manuel asked on 08 Oct 2014, 03:13 PM
I use a listview to display an image in a row and a description in another row. I'm trying to change the height of a smaller description but not work.

  
Private Sub RadListView1_VisualItemFormatting(sender As Object, e As ListViewVisualItemEventArgs) Handles RadListView1.VisualItemFormatting
    e.VisualItem.ImageLayout = ImageLayout.Stretch
 
    If Convert.ToInt32(e.VisualItem.Tag) / 2 = 0 Then 'images
        e.VisualItem.BackColor = Color.Azure
        e.VisualItem.Size = New Size(950, 259)
    Else 'descripcion of image
        e.VisualItem.BackColor = Color.Black
        e.VisualItem.Font = New Font("Consolas", 20, FontStyle.Bold)
        e.VisualItem.Size = New Size(950, 50)
    End If
 
End Sub

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 13 Oct 2014, 08:16 AM
Hi Manuel,

Thank you for writing.

Due to the virtualization in RadPageView visual items are being only created when needed and reused later on. In order to properly be able to mark certain items, you could use the Taproperty of the data items:
e.VisualItem.Data.Tag

Depending on where you are setting the tag, the way to set it would vary. For example, here is how to set it when creating an item:
Dim dataItem As New ListViewDataItem()
dataItem.Tag = 2

I hope this helps.

Regards,
George
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ListView
Asked by
Manuel
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or