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

Tooltip in DataGridCell

15 Answers 459 Views
GridView
This is a migrated thread and some comments may be shown as answers.
om
Top achievements
Rank 1
om asked on 23 Jan 2009, 05:40 PM
Does RadGridView has a support for tooltip? Is it provided through some kind of event  e.g. ToolTipTextNeeded even for winform grid view?

15 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 26 Jan 2009, 03:18 PM
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.
0
om
Top achievements
Rank 1
answered on 26 Jan 2009, 03:49 PM
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
0
Pavel Pavlov
Telerik team
answered on 27 Jan 2009, 05:55 PM
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.
0
om
Top achievements
Rank 1
answered on 29 Jan 2009, 08:21 PM
Thanks alot Pavel, and yeah its working all fine.
Thanks alot for such a great support!
0
Bonas Khanal
Top achievements
Rank 1
answered on 13 Jul 2009, 09:36 PM
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
0
Pavel Pavlov
Telerik team
answered on 16 Jul 2009, 04:29 PM

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.
0
Pranama Moorthy
Top achievements
Rank 1
answered on 05 Jul 2010, 04:26 AM
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.
0
Vlad
Telerik team
answered on 05 Jul 2010, 07:30 AM
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
0
Igor
Top achievements
Rank 1
answered on 01 Nov 2010, 10:02 AM

 

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.
0
Vlad
Telerik team
answered on 01 Nov 2010, 10:43 AM
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
0
SHEIKH
Top achievements
Rank 1
answered on 29 Nov 2010, 02:44 PM
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. 

0
Accepted
Veselin Vasilev
Telerik team
answered on 29 Nov 2010, 04:17 PM
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
0
SHEIKH
Top achievements
Rank 1
answered on 30 Nov 2010, 11:59 AM
just perfect! thanks again.

cheers!
0
Constantine
Top achievements
Rank 1
answered on 09 Dec 2010, 12:03 PM
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
0
Veselin Vasilev
Telerik team
answered on 14 Dec 2010, 05:06 PM
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
Tags
GridView
Asked by
om
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
om
Top achievements
Rank 1
Bonas Khanal
Top achievements
Rank 1
Pranama Moorthy
Top achievements
Rank 1
Vlad
Telerik team
Igor
Top achievements
Rank 1
SHEIKH
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Constantine
Top achievements
Rank 1
Share this question
or