HiAfter encoded in the manner described below:
private void InitTextEditorElement()
{ _ultraTextValueEditorElement = new UltraTextEditor(); grdListItems.DisplayLayout.Bands[0].Columns[0].ButtonDisplayStyle = ButtonDisplayStyle.Always;
_ultraTextValueEditorElement.EditorButtonClick += ultraTextValueEditorElement_EditorButtonClick; _ultraTextValueEditorElement.ButtonsRight.Add(GetNewEditor("_09_Donnees_16px", "INSERTDATA")); _ultraTextValueEditorElement.ButtonsRight.Add(GetNewEditor("Traduction_16px", "INSERTTRANSLATION")); _ultraTextValueEditorElement.ButtonsRight[0].Enabled = false; _ultraTextValueEditorElement.ButtonsRight[1].Enabled = false;
grdListItems.Rows[0].Cells[0].EditorComponent = _ultraTextValueEditorElement;
}
private EditorButton GetNewEditor(string imageName, string buttonName) { var editorButton = new EditorButton { Appearance = { Image = Module.ResourceManagerService.GetBitmap(imageName), ImageHAlign = HAlign.Center, ImageVAlign = VAlign.Middle, ImageBackgroundStyle = ImageBackgroundStyle.Stretched, ImageBackgroundOrigin = ImageBackgroundOrigin.Container } }; editorButton.Key = buttonName; return editorButton; }
How can I make the two buttons editor enabled again from grdListItems.Rows[0].Cells[0] ?
Hi,
Your solution works perfectly !
Thank you very much.
Regards
Christian Pokorny
You need to get the editor from the cell (not the EditorComponent).
Here's some sample code that will do this for any given a cell:
EmbeddableEditorButtonBase editor = cell.EditorResolved as EmbeddableEditorButtonBase; if (null != editor) { editor.ButtonsRight[0].Enabled = true; editor.ButtonsRight[1].Enabled = true; }