RadGridView: How do I display a background image?

1 Answer 353 Views
GridView
Troy
Top achievements
Rank 3
Bronze
Iron
Iron
Troy asked on 18 Apr 2022, 01:23 AM

There is a background image property for the gridview, but I can't seem to get it to do anything.  I'd like to have a background image cover the entire grid (not just a row/cell).  From the properties it seems this is possible, but nothing I do seems to make a change.

Thanks for any help!

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 18 Apr 2022, 02:17 PM

Hi, Troy,

Usually, the cell/row elements in RadGridView have a backcolor applied to them which is rendered above the background image. That is why in order to see the image, ensure that no fill color is applied: 

        public RadForm1()
        {
            InitializeComponent();
            this.radGridView1.ViewCellFormatting+=radGridView1_ViewCellFormatting;
            this.radGridView1.ViewRowFormatting+=radGridView1_ViewRowFormatting;
            
            this.radGridView1.TableElement.BackColor = Color.Transparent;
            this.radGridView1.BackgroundImage = Properties.Resources.London_01;
        }

        private void radGridView1_ViewRowFormatting(object sender, RowFormattingEventArgs e)
        {
            e.RowElement.DrawFill = false;
        }

        private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
        {
            e.CellElement.DrawFill = false;
        }

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
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
Troy
Top achievements
Rank 3
Bronze
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or