ColorPalette custom colors

  1. #1

    ColorPalette custom colors

    I have a brain freeze after watching the Denver/Pittsburg football game. How do I format the Colors parameter in the ColorPalette control.

    <ext:ColorPalette ID="ColorPalette1" runat="server" Colors=??>
  2. #2
    Hi,

    You should set up a respective Template.
    https://examples1.ext.net/#/ColorPal...c/Custom_View/

    The default Templace in JavaScript looks (JavaScript):
    '<tpl for="."><a href="#" class="color-{.}" hidefocus="on"><em><span style="background:#{.}" unselectable="on">&#160;</span></em></a></tpl>'
  3. #3
    Based on the description of the Colors parameter I thought you could provide a list of custom colors like

    Colors="F5A300,D2D223"
    But the format is incorrect when I run. It is trying to create a String array from the parameter.
  4. #4
    Yes, we don't parse a sting to get a string array.

    Please set up that property in code behind.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.ColorPalette1.Colors = new string[] { "F5A300", "D2D223" };
            }
        }
    </script>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:ColorPalette ID="ColorPalette1" runat="server" />
        </form>
    </body>
    </html>

Similar Threads

  1. Replies: 7
    Last Post: Feb 29, 2012, 11:53 AM
  2. DropDownField / ColorPalette problems
    By wexman in forum 1.x Help
    Replies: 4
    Last Post: May 25, 2011, 10:10 AM
  3. GridView with different row colors
    By flaviodamaia in forum 1.x Help
    Replies: 2
    Last Post: Feb 02, 2011, 12:16 PM
  4. [CLOSED] ColorPalette with custom colours
    By danielg in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 03, 2009, 9:49 AM
  5. GridPanel line colors
    By flaviodamaia in forum 1.x Help
    Replies: 2
    Last Post: Feb 06, 2009, 2:58 PM

Tags for this Thread

Posting Permissions