ScreenTip Usage

2 posts, 0 answers
  1. Claude
    Claude avatar
    38 posts
    Member since:
    Jun 2020

    Posted 07 Dec 2020 Link to this post

    I am having troubles with the ScreenTip on a gridview.  

    I can get the hovered text to show up in the StatusBar, but I do not get a popup over the hovered cell.  Not sure what I am doing wrong?

    GridDataCellElement cell = e.Item as GridDataCellElement;
                e.Delay = 0;
                RadOffice2007ScreenTipElement screenTip = new RadOffice2007ScreenTipElement();
                if (cell.ColumnIndex == 1)
                {
                    radLabelElement8.Text = cell.Text;  // StatusBar
                    screenTip.CaptionVisible = false;
                    screenTip.Text = cell.Text.ToString();
                   

                }

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4131 posts

    Posted 07 Dec 2020 Link to this post

    Hello, Claude,    

    I have prepared a sample code snippet demonstrating how to show screen tips for the cells in RadGridView. The text for a label element in RadStatusStrip is also updated:
            public RadForm1()
            {
                InitializeComponent();
                this.radGridView1.ScreenTipNeeded += radGridView1_ScreenTipNeeded;
            }
            
            RadOffice2007ScreenTipElement screenTip = new RadOffice2007ScreenTipElement();
    
            private void radGridView1_ScreenTipNeeded(object sender, ScreenTipNeededEventArgs e)
            {
                GridDataCellElement cell = e.Item as GridDataCellElement;
                e.Delay = 1;
               
                if (cell != null && cell.ColumnIndex == 1)
                {
                    this.radLabelElement1.Text = cell.Text;  // StatusBar
                    screenTip.CaptionVisible = false;
                    screenTip.MainTextLabel.Text = cell.Text.ToString();
                    cell.ScreenTip = screenTip;
                }
            }

    Additional information for screen tips is available here: https://docs.telerik.com/devtools/winforms/telerik-presentation-framework/tooltips-and-screentips/screen-tips 

    An alternative approach is to use tool tips for the grid cells: https://docs.telerik.com/devtools/winforms/controls/gridview/cells/tooltips 

    I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Back to Top