Generated Image Tooltip

2 posts, 0 answers
  1. Marek
    Marek avatar
    1 posts
    Member since:
    Jun 2016

    Posted 19 Oct Link to this post

    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.

  2. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    371 posts

    Posted 24 Oct Link to this post

    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!
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top