Hi,
I am working to support Thai language. The main problem is the UltraDateTimeEditor does not support to show Thai year correctly (Thai year = normal year + 543). I have made a custom control by combining UltraMaskedEdit, UltraMonthViewMulti. And it works fine.
The problem now is the editor for the cell in the grid. I cannot figure out how to make a custom editor similar like the one above. I tried to create a class to inherit from UltraMaskedEdit, then add the ButtonsRight and UltraMonthViewMulti but I always get this exception
Message: The Owner specified a type to EditorWithMask that is not supported by the editor.
StackTrace Information********************************************* at Infragistics.Win.UltraWinMaskedEdit.MaskInfo..ctor(EditorWithMask maskEditor, EmbeddableEditorOwnerBase owner, Object ownerContext) at Infragistics.Win.EditorWithMaskEmbeddableUIElement.SyncOwnerInfo(Boolean forceRegetValueFromOwner) at Infragistics.Win.EditorWithMaskEmbeddableUIElement.SyncOwnerInfo() at Infragistics.Win.EditorWithMaskEmbeddableUIElement.OnBeforeDraw() at Infragistics.Win.EditorWithMaskEmbeddableUIElement.PositionChildElements() at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UltraWinGrid.RowColRegionIntersectionUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UltraWinGrid.DataAreaUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UltraWinGrid.UltraGridUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(Boolean recursive) at Infragistics.Win.ControlUIElementBase.VerifyIfElementsChanged(Boolean verify, Boolean syncMouseEntered) at Infragistics.Win.ControlUIElementBase.VerifyIfElementsChanged(Boolean verify) at Infragistics.Win.ControlUIElementBase.ProcessMouseMoveHelper(Object sender, MouseEventArgs e) at Infragistics.Win.ControlUIElementBase.ProcessMouseMove(Object sender, MouseEventArgs e) at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e) at Infragistics.Win.UltraControlBase.OnMouseMove(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseMove(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Can someone show me the correct way to do a custom editor for a grid?
Hello Kim,
If I understand you correctly you have created an User Control and need to embed it in UltraGrid’s cell. Did you try to achieve this via UltraControlContainerEditor? This component provides you with the ability to embed non-editor controls in any Infragistics control that supports embeddable editors, like UltraGrid.
For additional information about how to embed any control into UltraGrid cell you may check the following article in our online documentation – “Embed Any Control within WinGrid Cell using UltraControlContainerEditor Component”.
Please let me know if this solves your issue or if you have any additional questions on this matter.
Hi Milko,
I have successfully create a custom editor using UltraControlContainerEditor. But I got an issue, when I tab out of the grid, the value of the cell is blank. I don't set the RenderingControl property, I just set EditingControl. EditingControlPropertyName will point to a property which is a DateTime? type.
Not sure if I miss anything?