Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
262
DisplayLayout.LoadFromXml does not work with this.DisplayLayout.Bands[0].Columns[columnName].EditorControl
posted

 

Hei i have a text editor defined as following

textEditor = new UltraTextEditor();
chkBtn = new EditorButton();
textEditor.ButtonsRight.Add(chkBtn);
textEditor.EditorButtonClick += new EditorButtonEventHandler(chkBtn_click);

I set the control to a column

this.DisplayLayout.Bands[0].Columns[columnName].CellMultiLine= Infragistics.Win.DefaultableBoolean.True;
this.DisplayLayout.Bands[0].Columns[columnName].EditorControl= textEditor;
this.DisplayLayout.Bands[0].Columns[columnName].EditorControl.Enabled = true;

I want the editor button to do some work on click, the code works fine.

but I loose my editor :(  ,  when i use same code with  LoadFromXml

Am i doing something wrong ?

 

 

 

 

 

 

 

 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

     The XML file cannot store an entire object like an editor. The thing to do is create the editor and attach it to the grid in the InitializeLayout event. That way it will get applied to the column every time you load the layout. 

    By the way, if you are going to create a control at run-time like you are doing here, it's a good idea to add that control to the Form's Controls collection. Otherwise, it will never be disposed and open up a potential memory leak. 

Children