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
60
Editor Button Display , read only UltraTextEditor
posted

Hi,
I have an UltraWinGrid in my application, and in one column of cells I need to have 2 editor buttons.
I have gotten 2 editor buttons by creating an UltraTextEditor and setting it as the EditorControl for the column.  This is the code I used.

        Dim textEditor As New Infragistics.Win.UltraWinEditors.UltraTextEditor
        Dim chkBtn As New Infragistics.Win.UltraWinEditors.EditorButton
        chkBtn.Appearance.Image = My.Resources.check
        chkBtn.Key = "Check"
        textEditor.ButtonsRight.Add(chkBtn)
        Dim ddBtn As New Infragistics.Win.UltraWinEditors.EditorButton
        ddBtn.Appearance.Image = My.Resources.ddarrow
        ddBtn.Key = "DropDown"
        textEditor.ButtonsRight.Add(ddBtn)
        AddHandler textEditor.EditorButtonClick, AddressOf UltraTextEditor_EditorButtonClick
        Me.TestGrid.DisplayLayout.Bands(1).Columns(2).EditorControl = textEditor

My problem is that I want my cell's text to be read-only.  It needs to be formatted a certain way so it's saved correctly.  I don't want the user being able to type in the cell.  They need to use the 2 buttons to edit the value.
I have other cells that are set up similar, but with only one editor button, so I just set that column's style to EditButton, and then handle the BeforeEnterEditMode event, and set e.cancel to true so the user can't edit it.

However, when I put an ultratexteditor in the cell, if I try to handle BeforeEnterEditMode and set e.cancel = true, I am not able to click on the buttons in my text editor.
I have also tried changing the CellActivation property to ActivateOnly or NoEdit, but AllowEdit is the only one that allows the text editor button clicks.
Unfortunately, that also allows text editing.

Does anyone have any ideas?? 
Is there a setting in the UltraTextEditor that could accomplish this?  I tried handling BeforeEnterEditMode on the text editor, but that did not work.
For some reason, BeforeEnterEditMode did not seem to fire on the text editor when it was in the grid.  (Yes, I had an AddHandler call in for it:        AddHandler textEditor.BeforeEnterEditMode, AddressOf UltraTextEditor_BeforeEnterEditMode)
Also, I tried this on an ultratexteditor that was not in the grid, and found that setting e.cancel = true in BeforeEnterEditMode caused me to not be able to click the buttons in the text editor.


I just need to make the text in the UltraTextEditor read-only, but still be able to click the buttons in the text editor.

 

Parents
No Data
Reply
  • 60
    posted

    I have also used ButtonDisplayStyle = Always , and CellActivation = ActivateOnly.

    But i dont want the button to display always , i need it on MouseEnter , and ButtonDisplayStyle = OnMouseEnter doesnt work with any of the cellactivation types

    Please let me know the solution ASAP>

Children