Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
255
GanttChart: Identify TimeEntry for Customized tooltip in IRenderLabel
posted

Hello,

I want to generate a customized tooltip for time entries. What I've done so far is:

Add the RenderLabel (copied from some sample code):

View.Chart.Tooltips.FormatString = "<GanttToolTip>";
Hashtable myHashTable = new Hashtable();
myHashTable.Add("GanttToolTip", new RenderLabel());
//Attach the Hash table to the Chart
View.Chart.LabelHash = myHashTable;

This works, however, I'm not sure what a good way is to actually identify the individual tasks within IRender.ToString. I currently set GanttTimeEntry.PercentComplete to a value that serves as a unique identifier (because I don't otherwise use PercentComplete) and that I can then read within IRender.ToString by looking at context["PERCENT_VALUE"], but this seems to be a somewhat ugly solution and perhaps I want to actually use PercentComplete in the future.

What is a better way to pass my own context information into the IRenderLabel or is there a different, better approach to do customized tooltips for each TimeEntry? The context variable does not seem to contain any other key I can set.

I also tried setting

View.Chart.Tooltips.FormatString = "<ITEM_LABEL>";

and

GanttTimeEntry.Label

but the tooltip then seems to be generated from GanttItem.Key, not GanttTimeEntry.Label...

Thanks!

Parents Reply Children