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

GridView Row ToolTip Template

1 Answer 589 Views
GridView
This is a migrated thread and some comments may be shown as answers.
band
Top achievements
Rank 1
band asked on 26 Jul 2016, 03:50 PM

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>

1 Answer, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 29 Jul 2016, 10:09 AM
Hi,

You can create a style that targets :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.
Tags
GridView
Asked by
band
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Share this question
or