ColorPicker.SelectedColor to hex?

2 posts, 0 answers
  1. tmorford
    tmorford avatar
    7 posts
    Member since:
    Jul 2007

    Posted 04 Nov 2010 Link to this post

    I am just wondering how to get the selected color to show up in #000000 etc... ?

  2. Tsvetie
    Tsvetie avatar
    1517 posts

    Posted 10 Nov 2010 Link to this post

    Hello tmorford,
    You can get the selected color in hex format either using the client-side API:

    <script type="text/javascript">
        function GetColor()
            var colorPicker = $find("<%= RadColorPicker1.ClientID %>");

    or using the ToHtml method of the System.Drawing.ColorTranslator class:

    protected void Page_Load(object sender, EventArgs e)
        Label1.Text = System.Drawing.ColorTranslator.ToHtml(RadColorPicker1.SelectedColor);

    All the best,
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top