GridView Row ToolTip Template

2 posts, 0 answers
  1. band
    band avatar
    12 posts
    Member since:
    Jun 2016

    Posted 26 Jul Link to this post

    Hi I have a datatemplate I would like to apply for the GridViewRow tooltip. May I ask how abouts I would do that?

     

    <DataTemplate x:Key="AppointmentToolTipTemplate">
        <Grid MaxWidth="300" Background="White">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="43" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <TextBlock Text="{Binding Subject}" Grid.ColumnSpan="2" TextWrapping="Wrap" Margin="5 8 4 3" FontWeight="Bold" />
            <Button IsEnabled="False" Background="Transparent" Grid.Row="1"  VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5 5 0 0" Width="28" Height="29" ContentTemplate="{StaticResource Calendar.Clock}"></Button>
            <StackPanel Orientation="Vertical" Grid.Column="1" Grid.Row="1" Margin="0 5 0 0">
                <StackPanel Orientation="Horizontal" Margin="0 0 0 0">
                    <TextBlock Text="{Binding Start, StringFormat='hh:mm tt', Mode=TwoWay}" TextWrapping="Wrap" FontSize="10" />
                    <TextBlock Text=" - " FontSize="10" />
                    <TextBlock Text="{Binding End, StringFormat='hh:mm tt', Mode=TwoWay}" TextWrapping="Wrap" FontSize="10" />
                </StackPanel>
                <TextBlock Text="{Binding Start, StringFormat='dddd dd MMM yyyy', Mode=TwoWay}" Margin="0 3" FontSize="10" />
            </StackPanel>
            <TextBlock Grid.Row="2" Grid.ColumnSpan="2" Text="{Binding Body}" Margin="5 3 5 8" TextWrapping="Wrap"  />
        </Grid>
    </DataTemplate>
  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    280 posts

    Posted 29 Jul Link to this post

    Hi,

    You can create a style that targets telerik:GridViewRow and set its ToolTip Property:

    <Style TargetType="telerik:GridViewRow" BasedOn="{StaticResource GridViewRowStyle}">
               <Setter Property="ToolTip">
                   <Setter.Value>
                       <ToolTip>
                           <TextBlock Text="{Binding Name}"></TextBlock>
                       </ToolTip>
                   </Setter.Value>
               </Setter>
           </Style>

    I hope this helps.

    Regards,
    Stefan Nenchev
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top