ForeColor - unknown entity 'color'

2 posts, 0 answers
  1. Matt
    Matt avatar
    13 posts
    Member since:
    Aug 2015

    Posted 27 Oct 2015 Link to this post

    I'm following the tutorial here to do some conditional styling on a radGrid.

    http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/appearance-and-styling/conditional-formatting

    But I am not able to use this:

    dataBoundItem["Approved"].ForeColor = Color.Red;

     The visual studio message is "Unknown entity 'color'

    and the display error message is:

    "Compiler Error Message: CS0103: The name 'Color' does not exist in the current context"

    What am I missing? Thanks!

     

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 27 Oct 2015 Link to this post

    Hi Matt,

    You need to include the System.Drawing namespace to resolve the issue:
    using System.Drawing;

    or:
    dataBoundItem["Received"].ForeColor = System.Drawing.Color.Red;

    Hope this helps.


    Regards,
    Konstantin Dikov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top