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

A question on the API (how to use a certain object)

1 Answer 24 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
G S S
Top achievements
Rank 1
G S S asked on 27 May 2009, 05:39 PM
The PagerStyle class is from the Telerik Grid API.

Color MyValue;
var color = RadGrid1.PagerStyle.BackColor;
color = MyValue;

PagerStyle returns GridPagerStyle. BackColor returns type Color.

If I edit the returned value by writing RadGrid1.PagerStyle.BackColor = Color(and however I manipulate this Color),

or write:

RadGrid1.PagerStyle.BackColor = MyValue (where MyValue is my own custom set variable).

Is there a difference in the end result? Is one approach preferred over the other?

Thanks

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 30 May 2009, 05:58 AM
Hi G S S,

The PagerStyle BackColor property has the same behavior as WebControl.BackColor, so you can refer to the ASP.NET documentation to learn more about it.

The end result when using the property is the same no matter how you set it, given that you supply a valid value. It matters whether you set BackColor programmatically or declaratively and want to use a HEX color representation:

declaratively
BackColor="#aabbcc"

programmatically:
BackColor = ColorTranslator.FromHtml("#aabbcc")

You should also be aware that BackColor does not influence/remove any background images applied to the element (control), so the applied background color will be visible only where there is no background image, unless you remove the background image explicitly with a CSS rule.


Best wishes,
Dimo
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.
Tags
General Discussions
Asked by
G S S
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or