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

Image In Cells

4 Answers 82 Views
VirtualGrid
This is a migrated thread and some comments may be shown as answers.
Sergey
Top achievements
Rank 2
Sergey asked on 02 Oct 2020, 09:21 AM
Hello, is it possible to add image inside the cell?

4 Answers, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 06 Oct 2020, 05:45 AM

Hello Sergey,

RadVirtualGrid cells support only text content. However, there is a feature request to allow placing any UI control in the cell. You can find it in the feedback portal where you can track its status.

In the meantime, you can try the CellDecorationNeeded event which allows you to set the background of each cell. In the event handler, you can create an ImageBrush and assign it to the Background of the cell.

Regards,
Martin Ivanov
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

0
Sergey
Top achievements
Rank 2
answered on 07 Oct 2020, 07:23 AM
Thanks you, and as I understand it, me still need to add this ImageBrush to the OnOverlayBrushesNeeded event?
0
Accepted
Martin Ivanov
Telerik team
answered on 08 Oct 2020, 12:50 PM

Hello Sergey,

This is correct. You will need to include the brush in the Brushes collection of the OnOverlayBrushesNeeded event. Also, keep in mind that the approach with the ImageBrush will work properly only if you have a different ImageBrush instance for each cell with an image. If there are several cells that share the same ImageBrush instance, the image will get stretched across the cells region.

Regards,
Martin Ivanov
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/.

0
Sergey
Top achievements
Rank 2
answered on 08 Oct 2020, 02:48 PM
Thanks for the help
Tags
VirtualGrid
Asked by
Sergey
Top achievements
Rank 2
Answers by
Martin Ivanov
Telerik team
Sergey
Top achievements
Rank 2
Share this question
or