Accessing C1Editor Properties

Posted by: khowell78737 on 10 September 2017, 11:30 am EST

  • Posted 10 September 2017, 11:30 am EST

    How do I set the properties for the C1Editor that don't show up on Visual Studio's property page?


    I specifically would like to set the DesignModeCss property at runtime from the vb code-behind.


    Thank you!


    Kevin Howell

  • Replied 10 September 2017, 11:30 am EST

    Please read the documentation about How to custom control's skin.

    After defining a style.css, you can set the following properties at code-behind file.

    //To use the external CSS file.
    this.C1Editor.UseEmbeddedVisualStyles= false

    //The custom style name.
    this.C1Editor.VisualStyle="Office2007Blue"

    //The external CSS file path.
    this.C1Editor.VisualStylePath="~/VisualStyles"

  • Replied 10 September 2017, 11:30 am EST

    Thank you for your answer, but you did not answer the question.


    Further- if I was wanting to reskin the control, I'd would have read the documentation about how to "custom control's skin" (as you put it)... berfore I posted... but that is NOT the question I asked.  And yes, I HAVE read the documentation..  You have to admit your documentation does leave alot to be desired...there's not much information outside of really basic usage... hence the question about an "advanced" feature


    I specifically asked if it was possible to access the  DesignModeCss attribute from the code behind..   I assume that this is the STYLE SHEET applied to the editor area of the control.  This would allow a user to see the content they're entering with the same styles that are applied to the site.  You can also reference style classes in the markup.


    This attribute is not referenced anywhere in the documation except in the API reference, which gives me no information on its use.


    So again,


    Is it possible to access DESIGNMODECSS from the code behind and if so... how if it doesn't appear as an attribute.


    And additionally:


    Does the DESIGNMODECSS attribute do what I think it does?  Specifically- apply a style sheet to the content window?  If it doesn't, what does?  Every editor has this ability (and is usually both a server-side and client side attribute) so I have to assume yours does too.


     

  • Replied 10 September 2017, 11:30 am EST

    > I specifically asked if it was possible to access the  DesignModeCss attribute from the code behind..  
    > I assume that this is the STYLE SHEET applied to the editor area of the control.
    > This would allow a user to see the content they're entering with the same styles that are applied to
    > the site.  You can also reference style classes in the markup.


    Now, I known your means. please ignore my previous reply.


    > Is it possible to access DESIGNMODECSS from the code behind and if so...
    how if it doesn't appear as an attribute.


    At present, it is not able to access DESIGNMODECSS from the code behind .


    but you can try the following code from the code behind:


    CSS file  ( StyleSheet.css )


    body
    {
        background-color:Yellow;
    }

    .class1
    {
       background-color:Red;   
    }


    code behind:


        this.C1Editor.Text = "test ";


     

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels