Skip to content

DevExpress-Examples/winforms-grid-display-popup-image-on-mouse-hover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WinForms Data Grid - Display popup images for grid rows (row indicator)

This example shows how to display super tooltips with images when a user hovers over a row indicator.

See the implementation of the ToolTipController.GetActiveObjectInfo event:

private void toolTipController1_GetActiveObjectInfo(object sender, ToolTipControllerGetActiveObjectInfoEventArgs e) {
    if (e.SelectedControl != gridControl1) return;
    ToolTipControlInfo info = null;
    SuperToolTip sTooltip1 = new SuperToolTip();
    try {
        GridView view = gridControl1.GetViewAt(e.ControlMousePosition) as GridView;
        if (view == null) return;
        GridHitInfo hi = view.CalcHitInfo(e.ControlMousePosition);
        if (hi.HitTest == GridHitTest.RowIndicator) {
            info = new ToolTipControlInfo(GridHitTest.RowIndicator.ToString() + hi.RowHandle.ToString(), "Row Handle: " + hi.RowHandle.ToString());
            ToolTipTitleItem titleItem1 = new ToolTipTitleItem();
            Image im = view.GetRowCellValue(hi.RowHandle, "Picture") as Image;
            ToolTipItem item1 = new ToolTipItem();
            item1.Image = im;
            sTooltip1.Items.Add(item1);
        }
        info = new ToolTipControlInfo(hi.HitTest, "");
        info.SuperTip = sTooltip1;
    }
    finally {
        e.Info = info;
    }
}

Files to Review

Documentation

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)