hi,
i need to use a different editor with different properties (MinValue, MaxValue, etc) for each cell in the grid
so i listen to InitializeRow event and did somthing like this
{
ProfileProperty property = (ProfileProperty)e.Row.ListObject;if (property.Type == PropertyTypeEnum.SingleValue) { --> CreateEditor(property, e.Row.Cells["Value"]); <--e.Row.ExpansionIndicator = ShowExpansionIndicator.Never; }else if (property.Type == PropertyTypeEnum.MultiValue) { e.Row.ExpansionIndicator = ShowExpansionIndicator.Always; }
ProfileProperty property = (ProfileProperty)e.Row.ListObject;
--> CreateEditor(property, e.Row.Cells["Value"]); <--e.Row.ExpansionIndicator = ShowExpansionIndicator.Never;
}
e.Row.ExpansionIndicator = ShowExpansionIndicator.Always;
ProfileProperty property = (ProfileProperty)e.Row.ParentRow.ListObject; --> CreateEditor(property, e.Row.Cells["Value"]); <--
--> CreateEditor(property, e.Row.Cells["Value"]); <--
switch (property.ValueType) {case PropertyValueTypeEnum.Boolean: CreateBooleanEditor(property, cell);break;case PropertyValueTypeEnum.Date: CreateDateEditor(property, cell); break;case PropertyValueTypeEnum.Float: CreateNumericEditor(property, cell);break;case PropertyValueTypeEnum.Integer: CreateNumericEditor(property, cell);break; }
CreateBooleanEditor(property, cell);
CreateDateEditor(property, cell);
break;
CreateNumericEditor(property, cell);break;
CreateNumericEditor(property, cell);
UltraNumericEditor intEditor = new UltraNumericEditor(); ((ISupportInitialize)intEditor).BeginInit(); // Set the value bounderiesif (property.Min != null) intEditor.MinValue = property.Min; if (property.Max != null) intEditor.MaxValue = property.Max; // determine the editor data typeswitch (property.ValueType) {case PropertyValueTypeEnum.Integer: intEditor.NumericType = NumericType.Integer;intEditor.MaskInput = "nnnnnnnnn"; break;case PropertyValueTypeEnum.Float: intEditor.NumericType = NumericType.Double;intEditor.MaskInput = "{{double:9.3}}";break; }if (property.DefaultValue != null) { intEditor.Nullable = true; intEditor.NullText = property.DefaultText; }intEditor.PromptChar = ' '; intEditor.ReadOnly = property.ReadOnly;intEditor.MaskDisplayMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.Raw; intEditor.MaskClipMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.Raw;intEditor.Name = property.Name + "editor";((ISupportInitialize)intEditor).EndInit(); cell.EditorControl = intEditor;
// Set the value bounderies
// determine the editor data type
intEditor.NumericType = NumericType.Integer;intEditor.MaskInput = "nnnnnnnnn"; break;
intEditor.NumericType = NumericType.Integer;
intEditor.NumericType = NumericType.Double;intEditor.MaskInput = "{{double:9.3}}";break;
intEditor.NumericType = NumericType.Double;
intEditor.Nullable = true; intEditor.NullText = property.DefaultText;
intEditor.NullText = property.DefaultText;
intEditor.ReadOnly = property.ReadOnly;
intEditor.MaskClipMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.Raw;
cell.EditorControl = intEditor;
UltraDateTimeEditor dateEditor = new UltraDateTimeEditor(); dateEditor.ReadOnly = property.ReadOnly; cell.EditorControl = dateEditor;
dateEditor.ReadOnly = property.ReadOnly;
cell.EditorControl = dateEditor;
UltraCheckEditor boolEditor = new UltraCheckEditor(); boolEditor.Enabled = property.ReadOnly; cell.EditorControl = boolEditor;
boolEditor.Enabled = property.ReadOnly;
cell.EditorControl = boolEditor;
for each row in the grid i created an editor control and set the " Value " cell editor with that control
its workin OK but the editors dose not work as i set them to work, like the NumericEditor show me the prompt char '_' insted of ' '
and when in double numeric type the input is displayed like this ' {________ . ___ } '
am i doin something wrong?
i just cant loose those prompt chars
and when i use the checkbox editor its not centerd in the cell and i could not find a property witch set it centered
moshe
The grid column has it's own PromptChar and other mask properties. To get it to pick up the mask properties of the editor, you have to set UseEditorMaskSettings on the column to true.
Thanks
and is there a way to make the checkbox centered?