- Home
- Forum
- Silverlight
- Tooltips in cells
Tooltips in cells
Private Sub UserControl_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
GridControl1.Model.RowCount = 3
GridControl1.Model.ColumnCount = 3
Dim style = GridControl1.Model(2, 2)
style.CellValue = "test"
style.ShowTooltip = True
style.TooltipTemplateKey = "celltipTemplate"
End Sub
The tooltip does not show, can you explain?
Thanks Kirk
You would also have to set the attached property in the grid as, GridTooltipService.ShowTooltips="True", this service would then show the tooltips based on your underlying CellValue.
Please let me know if this helps.
Thanks,
Fahad
Kirk
You have the whole GridStyleInfo set to the DataContext of your custom template. The below is the template we use internally to show the tooltip by default,
Background="{StaticResource LightBrush}"
BorderBrush="{StaticResource SolidBorderBrush}"
BorderThickness="1"
CornerRadius="4"
>
Let us know if that helps.
Thanks,
Fahad
Can you please post some more information on how the template in the above post can be used. I am trying to display a custom tooltip in a Silverlight Syncfusion grid and want to keep this seperate from the cellValue.
Thanks,
Peter
Hi Peter,
Apologize for the delay,
You can achieve your requirement by using GridStyleInfo.Tooltip instead of GridStyleInfo.CellValue to display a tooltip like as in the below code snippet,
Code Snippet:
<DataTemplate x:Key="templateTooltip"> <Border Background="LightGreen" BorderBrush="Black" BorderThickness="1" CornerRadius="2"> <StackPanel Margin="5" VerticalAlignment="Center" Orientation="Horizontal"> <Image Width="30" Height="30" VerticalAlignment="Center" Source="Images\phone.png" /> <TextBlock VerticalAlignment="Center" Text="{Binding Tooltip}" /> </StackPanel> </Border> </DataTemplate>
|
please refer the attached sample,
Please let us know if you have any queries,
Regards,
Jayapradha
CS_1846c684.zip
- 5 Replies
- 4 Participants
-
KP Kirk Pinneo
- Apr 20, 2010 04:47 PM UTC
- Dec 13, 2013 02:44 PM UTC