Unable to insert a button during page_Load when using ShowOnFocus

2 posts, 0 answers
  1. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 15 Sep 2009 Link to this post

    Hello,

    Following some samples in forums, my intention was to insert an EditorDropDown during Page_Load with
                            EditorDropDown ddn          =   new EditorDropDown("TranslateTool");  
                           ddn.Text                     =   "Translate";  
                           ddn.Width                    =   new Unit("130px");  
                            e1.Tools[0].Tools.Insert(0,ddn);    
     

    but I get a crash, my editor being created in OnInit with
                        RadEditor e1                    =   new RadEditor();  
                        e1.ID                           =   string.Format("RadEdt{0}_{1}",ID,fldName);  
                        e1.ToolbarMode                  =    EditorToolbarMode.ShowOnFocus;  
                        e1.Content                      =   desc.LongVal;  
                        e1.Width                        =   memoWidth;  
     

    I suspect that ShowOnfocus is the reason of this crash.

    Is it possible to insert a tool during Page_Load when using ShowOnFocus.

    Thanks for help.
    CS
  2. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 15 Sep 2009 Link to this post

    Solved sorry for posting too fast: the

    e1.EnsureToolsFileLoaded();

     


    was missing before the insert.

    CS
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top