ScreenTip Delay

5 posts, 0 answers
  1. Adam Beal
    Adam Beal avatar
    4 posts
    Member since:
    Jul 2009

    Posted 03 Nov 2010 Link to this post

    I am using the ScreenTip feature to show some extra info in my RadGridView row when mousing over. That is working great but the delay is a bit much before it pops up when you mouse over it. I noticed here that the regular ToolTip has lots of properties that can be set to adjust this:
    http://www.telerik.com/community/forums/winforms/gridview/tooltip-visible-time.aspx 

    I am wondering if you can include some code with samples here on how to do the same thing with the ScreenTip. Changing the code from that sample around didn't seem to work.

    Thanks in advance!
  2. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 10 Nov 2010 Link to this post

    Hi Adam,

    Thank you for the question.

    In order to change the delay, you need to change the value of the showDelay field. You should do this on the ScreenTipNeeded event. Please refer to the code snippet below for additional information:
    RadOffice2007ScreenTipElement screenTip = new RadOffice2007ScreenTipElement();
      
    private void radGridView1_ScreenTipNeeded(object sender, Telerik.WinControls.ScreenTipNeededEventArgs e)
    {
        GridDataCellElement cell = e.Item as GridDataCellElement;
      
        if (cell != null)
        {
            ComponentBehavior behavior = (cell.ElementTree.ComponentTreeHandler as IComponentTreeHandler).Behavior;
            PropertyInfo screenPresenterProperty = typeof(ComponentBehavior).GetProperty("ScreenPresenter", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetProperty);
            object screenTipPresenter = screenPresenterProperty.GetValue(behavior, null);
            Type radScreenTipType = screenTipPresenter.GetType();
      
            FieldInfo delayField = radScreenTipType.GetField("showDelay", BindingFlags.NonPublic | BindingFlags.Instance);
      
            int newDelayFieldValue = 1;
      
            delayField.SetValue(screenTipPresenter, newDelayFieldValue);
      
            cell.ScreenTip = screenTip;
            screenTip.MainTextLabel.Text = "SampleText";
        }
    }

    I hope you find this answer helpful. If you have further questions, feel free to contact me.

    Kind regards,
    Nikolay
    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
  3. stefano
    stefano avatar
    6 posts
    Member since:
    Apr 2011

    Posted 08 Oct 2013 Link to this post

    Hi,
    since the post is very old (2010) I'd like to know if it is now possible to set the "delay" property directly using the new version 2013.2.612.40

    Thank you for considering my request
  4. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 10 Oct 2013 Link to this post

    Hi Stefano,

    In the latest versions we have exposed the Delay property at the ScreenTipNeededEventArgs and you can set it as shown below:

    void radGridView1_ScreenTipNeeded(object sender, Telerik.WinControls.ScreenTipNeededEventArgs e)
    {
        e.Delay = 1;
    }

    I hope this helps.

    Regards,
    Nikolay
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  5. stefano
    stefano avatar
    6 posts
    Member since:
    Apr 2011

    Posted 11 Oct 2013 Link to this post

    Hi Nikolay,

    that's solve thanks!
Back to Top