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

Generated Image Tooltip

1 Answer 58 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Marek
Top achievements
Rank 1
Marek asked on 19 Oct 2016, 04:44 PM

Hi, it's possible to create GridView Row toolTip with Image whose ImageSource is generated from Row data?

In my application I've collection of objects in GridView. Objects contains a few properties for generate image. I want to show tooltip with image generated from row when mouse is over it.

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 24 Oct 2016, 10:47 AM
Hello Marek,

In order to achieve the desired result, you can handle RadGridView's RowLoaded event and set the tooltip of the current row there, possibly by using the DataElement property of the RowLoadedEventArgs:

public MainWindow()
{
    InitializeComponent();
    this.clubsGrid.RowLoaded += ClubsGrid_RowLoaded;
}
 
private void ClubsGrid_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
{
    var item = e.DataElement;
    BitmapImage tooltipImage = new BitmapImage();
    tooltipImage.BeginInit();
    tooltipImage.BaseUri = App.Current.StartupUri;
    tooltipImage.UriSource = new Uri("imageSource", UriKind.RelativeOrAbsolute);
    tooltipImage.EndInit();
    e.Row.ToolTip = new System.Windows.Controls.Image() { Source = tooltipImage };
}

Please let me know if this works for you.

Regards,
Dilyan Traykov
Telerik by Progress
Do you need help with upgrading your WPF project? Try the Telerik API Analyzer and share your thoughts!
Tags
GridView
Asked by
Marek
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or