DefaultEditorOwnerSettings editorSettings = null;
// Add an item for editing date. editorSettings = new DefaultEditorOwnerSettings( ); editorSettings.DataType = typeof( DateTime ); //editorSettings.MaskInput = "mm/dd/yyyy"; //editorSettings.MaskDataMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeBoth; editor = new DateTimeEditor( new DefaultEditorOwner( editorSettings ) ); editorsValueList.ValueListItems.Add( editor, "Date" ).Tag = editor;
int index = editorsValueList.FindStringExact( fieldType );
EmbeddableEditorBase editor = null; if (index >= 0) editor = (EmbeddableEditorBase)editorsValueList.ValueListItems[ index ].Tag; e.Row.Cells[ "Value" ].Editor = editor;
6/11/2010 : Object reference not set to an instance of an object. at Infragistics.Win.UltraWinMaskedEdit.EditInfo.MinValueForMask(Object minValue, String mask) at Infragistics.Win.UltraWinMaskedEdit.EditInfo.CalculateTrueMinValue() at Infragistics.Win.MonthDropDown.DoDropDown(EmbeddableUIElementBase element) at Infragistics.Win.DateTimeEditor.DoDropDown() at Infragistics.Win.EmbeddableEditorBase.DropDown() at Infragistics.Win.DateTimeEditorDropDownButtonUIElement.OnMouseDown(MouseEventArgs e, Boolean adjustableArea, UIElement& captureMouseForElement) at Infragistics.Win.ControlUIElementBase.ProcessMouseDownHelper(Object sender, MouseEventArgs e) at Infragistics.Win.ControlUIElementBase.ProcessMouseDown(Object sender, MouseEventArgs e) at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e) at Infragistics.Win.UltraControlBase.OnMouseDown(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(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)
ray023 said:Object reference not set to an instance of an object. at Infragistics.Win.UltraWinMaskedEdit.EditInfo.MinValueForMask(Object minValue, String mask) at Infragistics.Win.UltraWinMaskedEdit.EditInfo.CalculateTrueMinValue()
Hi,
It's really hard to tell much from the code snippets you posted here. There's no indication here about what editorsValueList is or how it related to the issue at hand.
It's also quite puzzling why you would use an DefaultEditorSettings object just to set the DataType. Is the column you are using not already a DateTime type? If not, then what type is it?
You appear to be jumping through some hoops here, presumably to work around some underlying problem, but I can't even guess what that problem might be or why you are taking the approach you are taking.
Can you explain in more detail why you are doing all this?