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

ScreenTip Usage

1 Answer 165 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Claude
Top achievements
Rank 1
Iron
Veteran
Claude asked on 07 Dec 2020, 11:56 PM

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();
               

            }

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 08 Dec 2020, 05:41 AM
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/.

Tags
GridView
Asked by
Claude
Top achievements
Rank 1
Iron
Veteran
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or