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

Radgrid cell background image

2 Answers 249 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 22 Mar 2012, 05:06 PM
Hi,

How do I programmatically set the background of a radgrid cell to an image? I'm currently setting the background colour but need to set it to an image and still be able to have foreground text over the top. Here's what I'm currently using...

For Each grow As Telerik.Web.UI.GridDataItem In GridView1.Items
    

 

    grow.Cells(1).BackColor = Drawing.Color.Transparent    
    grow.Cells(1).Text = "Blah"

 

Next

 

 



2 Answers, 1 is accepted

Sort by
0
Alex
Top achievements
Rank 1
answered on 26 Mar 2012, 10:47 AM
I have now figured this one out

grow.Cells(1).cssclass = "CellWithBackgroundImage"

(In stylesheet)

.CellWithBackgroundImage
{
background: url('backgroundimage.png') repeat-x 0 0;
}
0
Eyup
Telerik team
answered on 26 Mar 2012, 01:58 PM
Hi Alex,

I am glad that you have figured out the solution yourself. Keep in mind that you can also use the aproach showed below:
background: center center url('backgroundimage.png');
Good luck with your project.

All the best,
Eyup
the Telerik team

If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Alex
Top achievements
Rank 1
Answers by
Alex
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or