We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Tooltips in cells

Thread ID:

Created:

Updated:

Platform:

Replies:

94066 Apr 20,2010 12:47 PM Dec 13,2013 09:44 AM Silverlight 5
loading
Tags: GridControl
Kirk Pinneo
Asked On April 20, 2010 12:47 PM

In silverlight 4, I tried to add a tooltip to a cell using your documented procedures. I added the template in the xaml and then add the following code to the loaded event:

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

Mohamed Suhaib Fahad A. [Syncfusion]
Replied On April 22, 2010 05:32 AM

Hi 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 Pinneo
Replied On April 23, 2010 12:04 AM

Thanks that works, is the CellValue the only property that can be displayed as a tooltip? I tried binding to other properties within the datacontext for the cell and it did not work.
Kirk

Mohamed Suhaib Fahad A. [Syncfusion]
Replied On April 23, 2010 05:52 AM

Hi 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,


Name="Border"
Background="{StaticResource LightBrush}"
BorderBrush="{StaticResource SolidBorderBrush}"
BorderThickness="1"
CornerRadius="4"
>




Let us know if that helps.

Thanks,
Fahad

Peter Magrath
Replied On February 7, 2011 11:09 PM

Hi Mohamed,

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


Jayapradha S [Syncfusion]
Replied On December 13, 2013 09:44 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;