Please advise on how to hide an Editor in a cell of the UltraWinGrid, specifically a CheckEditor.
((Infragistics.Win.CheckEditor)e.Row.Cells["Prepared"].Editor).
gives me no InstanceProperties, SharedProperties or Visible property to set.
Perhaps you may (disable the edit and) set the style to custom: Cells["Selected"].AllowEdit = AllowCellEdit.Disabled;
Perhaps you may (disable the edit and) set the style to custom:
Cells["Selected"].AllowEdit = AllowCellEdit.Disabled;
((CheckEditor)Cells["Selected"].Editor).Style = EditCheckStyle.Custom;
You don't need to set an Editor. You could achieve the same thing more efficiently by simply setting the Style property on the cell to Edit.
I assume you are also disabling the cell (by setting the Activation property on the cell) so the users don't click in that cell and get a caret.
There are several ways to skin that cat...I don't see anything wrong with your approach, and it is probably the easiest way. Another approach would be to use the IUIElementCreationFilter interface to remove the checkbox elements from those cells; you could also assign an EditorWithText like you are doing and then use the IEditorDataFilter interface to prevent the values from appearing. Note however that both of these approaches would require a little more coding than your approach.
Hi Mike and Brian
Thanks for trying to help.
Essentially, my client does not want to see a CheckBox editor for some of the cells.
On certain conditions it is required for me to display a "Disabled" or "Unavailable" background
image, instead of the editor. As it is a Boolean field, the default editor is a CheckBoxEditor.
I have now set the Editor of the columbn to EditorWithText, and on the
InitializeRow I test for certain conditions, and possibly set the cell's ForeGroundAlpha to Transparent,
as well as show a "disabled" ImageBackground for the cell.
Would you guys assume that to be the easiest / best way to do this?
I'm not sure I understand what you mean by "hiding" an editor. You can hide the column by setting its Hidden property to true (yes, I know, bad naming there). You can change the editor that column uses by assigning (for example) an EditorWithText to the column's Editor property, in which case "True" and "False" will be displayed instead of a checkbox. If none of this is helpful please repost with details about exactly what you mean by hiding an editor.