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

Set the background image through the stylesheet

2 Answers 188 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Yuvika
Top achievements
Rank 1
Yuvika asked on 16 Mar 2009, 02:50 PM
Hi,
 
I have added a textbox dynamicllay in footer of page. And I want to set the style of that textbox as the background image But if I set the backgroundImage atrribute in Stylesheet.xml then it throws an error at that line. Please help - How can i create a style sheet with background image.

http://picasaweb.google.com/yuvika.1may/UntitledAlbum?feat=directlink#5313802050885294866
Code is there in the above link.

I tried setting the background image in code also but it shows that it is read only property.
Please reply if I can set the background image to textbox added dynamically????

Thanks
Yuvika

2 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 19 Mar 2009, 01:34 PM
Hello Yuvika,

You should use the Style.BackgroundImage.ImageData for this case e.g.:

Image myImg = Image.FromFile("img.jpg");
textFooter1.Style.BackgroundImage.ImageData = myImg;

Greetings,
Steve
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Yuvika
Top achievements
Rank 1
answered on 19 Mar 2009, 02:03 PM
Hello,

Thanks for the reply Steve.

One more solution I used is I put the file in Resource and then I use the following code to set the background of the textbox dynamicllay. In this case my name of image is "aro_up".

textFooter1.Style.BackgroundImage.ImageData = PO_ReportsLibrary.Properties.

Resources.aro_up;

Thanks
Yuvika

Tags
General Discussions
Asked by
Yuvika
Top achievements
Rank 1
Answers by
Steve
Telerik team
Yuvika
Top achievements
Rank 1
Share this question
or