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.
Thanks,~Karen
Hi,
There's no way to do that. If the cell is read-only, it will not be able to enter edit mode and so the user will be unable to click the buttons.
Mike,
I am also facing the same issue ,
I want to use ButtonDisplayStyle = OnMouseEnter , and not always
Please let me know the solution to this.
I have my column's ButtonDisplayStyle set to OnMouseEnter, and I see the buttons when I hover over the cell. I have also tried setting the ButtonDisplayStyle to Always.
It seems that ButtonDisplayStyle = Always and CellActivation = ActivateOnly works for clicking the button and not editting text. I think this will work for me. It's too bad that ButtonDisplayStyle = OnMouseEnter won't work - I don't really like having to display the buttons all the time. I tried ButtonDisplayStyle = OnMouseEnter with each of the CellActivation choices, and none of them seem to work.
Thanks for the help.~Karen
Hi Karen,
When you use an editor to provide the button, the buttons will only display when the cell enters edit mode. I beleive the only exception to this is if you set ButtonDisplayStyle on the column to Always. Then you can use CellActivation on the column to disallow editing while still allowing the user to click the button.