Why the properties of a CustomAppointment class can't display in tooltip ?

2 posts, 0 answers
  1. Carlos
    Carlos avatar
    6 posts
    Member since:
    Aug 2012

    Posted 07 Mar 2013 Link to this post

    public class CustomAppointment : Appointment
        {
            public string Domain { get; set; }
    public string Status { get; set; }
        }


    <DataTemplate x:Key="CustomAppoinementToolTipTemplate">
                <Grid MaxWidth="300">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <TextBlock Text="{Binding Subject}" Grid.Row="0" TextWrapping="Wrap" Margin="5 8 4 3" FontWeight="Bold" />
                    <StackPanel Orientation="Horizontal" Margin="5 8 4 3" Grid.Row="1">
                        <TextBlock Text="Domain: " FontSize="10" />
                        <TextBlock Text="{Binding Domain}" FontSize="10" />
                        <TextBlock Text="Status: " FontSize="10" />
                        <TextBlock Text="{Binding Status}" FontSize="10" FontWeight="Bold"/>
                    </StackPanel>
                </Grid>
            </DataTemplate>

    The "Subject" can display in the tooltip .
    "Domain" and "Status" can't display in the tooltip finally.
    Why?
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 12 Mar 2013 Link to this post

    Hello Carlos,

    Please change the bindings like this:

    <DataTemplate x:Key="CustomAppoinementToolTipTemplate">
        <Grid MaxWidth="300">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <TextBlock Text="{Binding Subject}" Grid.Row="0" TextWrapping="Wrap" Margin="5 8 4 3" FontWeight="Bold" />
            <StackPanel Orientation="Horizontal" Margin="5 8 4 3" Grid.Row="1">
                <TextBlock Text="Domain: " FontSize="10" />
                <TextBlock Text="{Binding Appointment.Domain}" FontSize="10" />
                <TextBlock Text="Status: " FontSize="10" />
                <TextBlock Text="{Binding Appointment.Status}" FontSize="10" FontWeight="Bold"/>
            </StackPanel>
        </Grid>
    </DataTemplate>


    Kind regards,
    Yana
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top