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
655
ultraWinGrid - How Enable/disable editor buttons in an ultraTextEditor
posted

Hi

After 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] ? 

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi,

    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;
                }

Reply Children
No Data