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

2 posts, 0 answers
  1. G S S
    G S S avatar
    85 posts
    Member since:
    Mar 2008

    Posted 27 May 2009 Link to this post

    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?


  2. Dimo
    Dimo avatar
    8406 posts

    Posted 30 May 2009 Link to this post

    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:


    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,
    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.
Back to Top