This is a migrated thread and some comments may be shown as answers.

Unable to insert a button during page_Load when using ShowOnFocus

1 Answer 46 Views
Editor
This is a migrated thread and some comments may be shown as answers.
CSurieux
Top achievements
Rank 2
CSurieux asked on 15 Sep 2009, 06:00 PM
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

1 Answer, 1 is accepted

Sort by
0
CSurieux
Top achievements
Rank 2
answered on 15 Sep 2009, 07:55 PM
Solved sorry for posting too fast: the

e1.EnsureToolsFileLoaded();

 


was missing before the insert.

CS
Tags
Editor
Asked by
CSurieux
Top achievements
Rank 2
Answers by
CSurieux
Top achievements
Rank 2
Share this question
or