1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / How to add select button to select color

How to add select button to select color

7 posts, 0 answered
  1. Tim
    Tim avatar
    156 posts
    Registered:
    23 Sep 2007
    27 Sep 2007
    Link to this post
    Sitefinity Team,

    I am just wondering if you could show me how to add button to select color on the web user control I create.

    Thanks in advance
    Tim
  2. Yasen
    Yasen avatar
    121 posts
    Registered:
    18 May 2013
    27 Sep 2007
    Link to this post
    Hello Tim,

    As far as I understand you, you want to have a color picker in your control. If you need that, you can use the ColorPicker control located in the Telerik.Cms.Web.UI assembly. This is the control Sitefinity uses to edit properties of type System.Drawing.Color in edit mode for controls.

    Do let us know if you need any further assistance.

    Regards,
    Yasen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Tim
    Tim avatar
    156 posts
    Registered:
    23 Sep 2007
    27 Sep 2007
    Link to this post
    Thanks, it's working.

    Another question, how can I add button into web user control to edit font info?

    Tim
  4. Vlad
    Vlad avatar
    498 posts
    Registered:
    19 Jun 2017
    01 Oct 2007
    Link to this post
    Hello Tim,

    Unfortunately, we cannot understand your question.
    Actually, if the property is of type System.Web.UI.WebControls.FontInfo the Edit button appears automatically on the right side of the property.
    Could you please give us some code example of the user control?

    Kind regards,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Tim
    Tim avatar
    156 posts
    Registered:
    23 Sep 2007
    01 Oct 2007
    Link to this post
    Sorry, I didn't make myself clear.

    Following is my property in C# and Unfortunately Edit button doesn't show up automatically on the right side of the property.


    private System.Web.UI.WebControls.FontInfo _headTextFontInfo; 
        public System.Web.UI.WebControls.FontInfo HeadTextFontInfo 
        { 
            set 
            { 
                _headTextFontInfo = value; 
            } 
            get 
            { 
                return _headTextFontInfo; 
            } 
        } 


    Please let me know if I did anything wrong.

    Thanks
    Tim
  6. Vlad
    Vlad avatar
    498 posts
    Registered:
    19 Jun 2017
    01 Oct 2007
    Link to this post
    Hello Tim,

    The Edit button is not displayed for HeadTextFontInfo property in your User Control, because it is null - you cannot edit the properties of an object which is null.
    The correct implementation should be the following:

    in the .ascx file:
    <asp:Label ID="lblHeadText" runat="server"></asp:Label> 

    in the ascx.cs file:
        public FontInfo HeadTextFontInfo  
        {  
            get 
            {  
                return lblHeadText.Font;  
            }  
        }    
     


    Hope this is helpful.

    Sincerely yours,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Tim
    Tim avatar
    156 posts
    Registered:
    23 Sep 2007
    01 Oct 2007
    Link to this post
    Thanks, it does hep.

    Tim
Register for webinar
7 posts, 0 answered