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

Bug in VS template

1 Answer 23 Views
Installer and VS Extensions
This is a migrated thread and some comments may be shown as answers.
ghini
Top achievements
Rank 2
ghini asked on 31 Jan 2020, 12:48 PM

Hi if you open Visual Studio 2019 with Telerik ASP.NET v

Go in Extensions menù > Telerik > Telerik UI for ASP.NET > Create New Telerik Project...

later choose "Telerik VB Web Form Site" and RESPONSIVE template.

This code in file "ListView.aspx" not run properly:

    Protected Sub RadListViewImages_ItemDataBound(sender As Object, e As Telerik.Web.UI.RadListViewItemEventArgs)
        Dim item As RadListViewDataItem = TryCast(e.Item, RadListViewDataItem)
        Dim description As String = TryCast(item.DataItem, Image).Description
        If description.Length > 100 Then
            description = description.Substring(0, 97) + "..."
            TryCast(item.FindControl("LabelShortDescription"), Literal).Text = description
        End If
    End Sub

 

I think it should be replaced with this:

    Protected Sub RadListViewImages_ItemDataBound(sender As Object, e As Telerik.Web.UI.RadListViewItemEventArgs)
        Dim item As RadListViewDataItem = TryCast(e.Item, RadListViewDataItem)
        Dim description As String = TryCast(item.DataItem, Image).Description
        If description.Length > 100 Then
            description = description.Substring(0, 97) + "..."
        End If
        TryCast(item.FindControl("LabelShortDescription"), Literal).Text = description
    End Sub

Thanks

 

1 Answer, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 05 Feb 2020, 11:49 AM

Hello,

You are absolutely correct, the TryCast should be outside the IF condition in order to work properly with different description length. We will fix it as soon as possible in one of the upcoming releases of the Visual Studio Extensions. 

As a token of gratitude for helping us identify this issue, we have updated your Telerik points.

Regards,
Peter Milchev
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
Tags
Installer and VS Extensions
Asked by
ghini
Top achievements
Rank 2
Answers by
Peter Milchev
Telerik team
Share this question
or