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

Is each ScreenTip cached?

2 Answers 66 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
xclirion
Top achievements
Rank 1
xclirion asked on 11 Aug 2010, 10:16 AM
Hi,

I have a GridView and when someone hovers over a cell a ScreenTip is displayed with some more informations. Works good, but now there was a need to add a button where the user can turn off these ScreenTips. And surprisingly even after turning them of some ScreenTips are still getting displayed. For us it seems that all ScreenTips which have been already displayed seems to get displayed without calling the ScreenTipNeeded Event.

How can I change this behaviour?

Thanks,
Michael

2 Answers, 1 is accepted

Sort by
0
Accepted
Martin Vasilev
Telerik team
answered on 16 Aug 2010, 07:45 PM
Hello Michael Topf,

Thank you for writing.

I am not sure how exactly you have implemented the adding of ScreenTips in your project. If you create a ScreenTip reference in ScreenTipNeeded event, it will remain even after you have unsubscribed from the event. You can turn off the screen tips by using a flag and the ScreenTipNeeded event. Please consider the following code as example:

bool _screenTipsOn = true;
void radGridView1_ScreenTipNeeded(object sender, ScreenTipNeededEventArgs e)
{
    if (_screenTipsOn)
    {
        RadOffice2007ScreenTipElement screenTip = new RadOffice2007ScreenTipElement();
        GridDataCellElement cell = e.Item as GridDataCellElement;
        if (cell != null)
        {
            screenTip.MainTextLabel.Text = cell.Value.ToString();
        }
        cell.ScreenTip = screenTip;
    }
    else
    {
        RadScreenTipElement element = e.Item.ScreenTip;
        if (element != null)
        {
            e.Item.ScreenTip = null;
            element.Dispose();
        }
    }
}
private void radButton1_Click(object sender, EventArgs e)
{
    _screenTipsOn = !_screenTipsOn;
}

I hope this helps. Let me know if you have any additional questions.

Sincerely yours,
Martin Vasilev
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
xclirion
Top achievements
Rank 1
answered on 17 Aug 2010, 07:33 AM
Hello Martin,

thanks, that was the solution.

Michael
Tags
General Discussions
Asked by
xclirion
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
xclirion
Top achievements
Rank 1
Share this question
or