Binding problems custom class

2 posts, 0 answers
  1. Jerry
    Jerry avatar
    3 posts
    Member since:
    Jan 2010

    Posted 05 Jan 2010 Link to this post

    Hi all,

    I'm trying to use a List of custom class to fill the itemsSource of RadCarousel.

    This is the code of Page1.xaml:

    <Page x:Class="Page1" 
            <telerik:RadCarousel x:Name="carPacientes" HorizontalAlignment="Stretch" 
                    VerticalAlignment="Stretch" Background="Black" AutoGenerateDataPresenters="False" Foreground="White"
                    <Style TargetType="telerik:CarouselItem"
                        <Setter Property="Template"
                                <ControlTemplate TargetType="telerik:CarouselItem"
                                    <Label Content="{Binding Path=Apellidos}" FontSize="12" Foreground="Black" Background="Aqua" /> 

    And this is the code to fill the RadCarousel Page1.xaml.vb:

    Imports MDOL.Business.Logic 
    Partial Public Class Page1 
        Public Shared opcion As String 
        Public Sub New() 
            Dim pacs As List(Of Paciente) = New List(Of Paciente) 
            Dim pac As Paciente = Nothing 
            For i = 1 To 10 
                pac = New Paciente 
                pac.IdPaciente = Convert.ToString(i) 
                pac.Nombre = "Gerard" 
                pac.Apellidos = "Subirana" 
                pac = Nothing 
            Me.carPacientes.ItemsSource = pacs 
        End Sub 
    End Class 

    When I run the application appears 10 radcarousel items but the labels with the property Apellidos still empty... what's wrong?

    Thank's in advance.

  2. Rossen Hristov
    Rossen Hristov avatar
    2478 posts

    Posted 06 Jan 2010 Link to this post

    Hi Gerard Subirana Roger,

    Please check out the Carousel -> CustomItemTemplate example in our online examples.

    You might also want to check out the Carousel Items Documentation Topic.

    Let us know if this does not help.

    All the best,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top