Tooltip in DataGridCell

16 posts, 1 answers
  1. om
    om avatar
    26 posts
    Member since:
    Jan 2009

    Posted 23 Jan 2009 Link to this post

    Does RadGridView has a support for tooltip? Is it provided through some kind of event  e.g. ToolTipTextNeeded even for winform grid view?
  2. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 26 Jan 2009 Link to this post

    Hello ohm,

    The framework provides generic support for tooltips (ToolTipService.Tooltip) and the RadGridView has no specific support for tooltips. We do not have any  tooltip related events so far.

    If you  need a tooltip for a cell the standard approach would be  to add a tooltip by modifying the cell template.

    I am not sure if the given approach would serve your scenario. If you give me some more details on what behavior you are trying to achieve I may be able to prepare a small sample app with a solution or a workaround.

    Kind regards,
    Pavel Pavlov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. om
    om avatar
    26 posts
    Member since:
    Jan 2009

    Posted 26 Jan 2009 Link to this post

    Hi Pavel,

    In my scenario of using Grid. I have turned the auto generate column off and then I am creating all the columns dynamically. and in our grids there are very few instances where we need to specify the datatemplate to GridColumns and for DataTemplates we define them in App.xaml usaully or on the page which hosts the Grid.

    Now the complication will occur when we will need to display the tooltip for every single column, which infer that we will have to define DataTemplate for possible column, because in datatemplate we will then use the ToolTipService.ToolTip to set the tooltip.

    The tooltip we need to display in grid will be exactly same as the text of the bound property and I was thinking that it will be really nice if we can turn the tooltips on for all the columns dynamically and set the tooltip of the column equal to the binded property of the entity.

    I don't know really know if it is really possible with current version of silverlight or not.

    I will highly appriciate your response in this matter.

    Thanks
    OM
  5. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 27 Jan 2009 Link to this post

    Hi om,

    I am attaching a small sample project .
    The goal was to set the ToolTips to cells displaying the value of  the bound property  per cell.
    You mentioned you create the columns dynamically, so  I have extracted the logic to set the tooltips in a separate method  (please see the ApplyCellTemplateToColumns method).

    The approach here was: I have added a template for the GridViewCell to the resources of the page. It has been slightly modified to display a tooltip bound to the value of the cell.

    The method  ApplyCellTemplateToColumns  sets this template to the columns anytime when  it's called.
    So after creating columns we just  need to call this method.

    All the best,
    Pavel Pavlov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. om
    om avatar
    26 posts
    Member since:
    Jan 2009

    Posted 29 Jan 2009 Link to this post

    Thanks alot Pavel, and yeah its working all fine.
    Thanks alot for such a great support!
  7. Bonas Khanal
    Bonas Khanal avatar
    3 posts
    Member since:
    Jun 2009

    Posted 13 Jul 2009 Link to this post

    Is there a way to do this selectively on rows .
    I have been trying some color coding and i want to show this tooltip only on few rows, whereve say price of a product is greater than 10000 and want to customize tooltip to show some text.

    Thanks
    Bonas
  8. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 16 Jul 2009 Link to this post

    Hello Bonas ,

    To selectively apply tooltips to cells  you need to handle the RadGridView.RowLoaded event. Within the event you may iterate trough cells ( e.g. e.Row.Cells), check the values and explicitly set tooltips or cell formatting.

    In case you have troubles implementing this I will be glad to provide further assistance.

    Kind regards,

    Pavel Pavlov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  9. Pranama Moorthy
    Pranama Moorthy avatar
    26 posts
    Member since:
    Jun 2010

    Posted 04 Jul 2010 Link to this post

    This code somehow did not work for me, when I debugged it, I found that the Columns Count in the for loop for ApplyCelltemplate Column came to 0. Am i suppose to trigger soem event?

    My main method looks like below

    public

     

    MainPage()

     

    {

     

    // Required to initialize variables

     

    InitializeComponent();

     

    this.CoverageGrid.ItemsSource=this.GetCustomers();

     

    ApplyCellTemplateToColumns();

     

    }


    Also I have added the Grid Resource mentioned, and I am creating the columns using Autogenerate Columns= true. Pleasea advice.
  10. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 05 Jul 2010 Link to this post

    Hi,

     Why not use ToolTipTemplate or ToolTipTemplateSelector column properties directly?

    Greetings,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  11. Igor
    Igor avatar
    5 posts
    Member since:
    Oct 2010

    Posted 01 Nov 2010 Link to this post

     

    Hi,

    Resurrecting this thread... Are there some code examples around showing how to implement ToolTipTemplateSelector  ?  I found one in demo but there's only xaml w/o binding code.

    Thanks,
                 -Igor.
  12. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 01 Nov 2010 Link to this post

    Hi,

     You can check your local copy of our demos for more info about the selector and converter.

    Sincerely yours,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  13. SHEIKH
    SHEIKH avatar
    43 posts
    Member since:
    Sep 2010

    Posted 29 Nov 2010 Link to this post

    Hi everyone,
    I'm looking for the tooltip of a RadGridView cells. I need to display the same value in the tooltip as its assigned to the cell, the only difference will be that my RadGridView column will be showing the trimmed value in the beginning. I know its should be pretty simple to do but I'm facing problems with the demo and a sample that I've got after searching through this forum and I couldn't find any sample working for me. I tried to look into ToolTipTemplateSelector demo but I couldn't get it work as I don't really know that why I need so many converters and all other tags as I just need to put the same value in the tooltip as that of cell value.


    Is there any simpler/plain version I can find how to do it?

    thanks in advance. 

  14. Answer
    Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 29 Nov 2010 Link to this post

    Hi SHEIKH,

    The GridViewColumn class has a property ToolTipTemplate.
    What you need to do is to define your tooltip as a DataTemplate (as a resource) and assign it to the ToolTipTemplate property of each column.

    I have attached a sample project.


    All the best,
    Veselin Vasilev
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  15. SHEIKH
    SHEIKH avatar
    43 posts
    Member since:
    Sep 2010

    Posted 30 Nov 2010 Link to this post

    just perfect! thanks again.

    cheers!
  16. Constantine
    Constantine avatar
    3 posts
    Member since:
    Oct 2009

    Posted 09 Dec 2010 Link to this post

    Hi

    Thanks for the provided solution with tooltips. It's really great.

    But I want to ask why Grid binding occurs in System.Threading.Thread.CurrentThread.CurrentCulture locale
    but tooltip data is displayed in System.Threading.Thread.CurrentThread.CurrentUICulture locale.

    Konstantin
  17. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 14 Dec 2010 Link to this post

    Hi Constantine,

    Please set the ConverterCulture property of the Binding of the tooltip:

    <TextBlock Text="{Binding Established, StringFormat=d, ConverterCulture=es}" />

    Hope this helps.

    Regards,
    Veselin Vasilev
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
Back to Top
DevCraft banner