Platform: .NET 3.5 MVC2Version: 2011.2Browser: IE8
We are dynamically building a grid model with cell editing enabled and passing it to a MVC2 view. The editors for each column are numeric with a data mode of DataMode = NumericEditorDataMode.Int. The grid is built to generate columns dynamically based on user input, so using the GridModel was our best choice to avoid unnecessary overhead.
Our issue is that validation is not working and the event 'igvalidatorvalidation' is never fired, even though on 'iggridupdatingeditcellstarted' I can break and see that ui.owner.options.columnSettings[4].editorOptions.validatorOptions are populated correctly based on the GridModel that was passed to the view.
Is there something I'm missing? Here is the relevant code:
var cs = new ColumnUpdatingSetting();cs.ReadOnly = false; cs.EditorType = ColumnEditorType.Numeric; cs.Validation = true; cs.Required = true; cs.NumericEditorOptions = new ColumnUpdatingNumericEditorOptions { DataMode = NumericEditorDataMode.Int, MinValue = 0, MaxValue = 1000000, ValidatorOptions = new EditorValidatorOptions { KeepFocus = ValidatorKeepFocus.Always, OnBlur = true, OnChange = true, OnSubmit = true, ShowIcon = true, CustomErrorMessage = "Value must be between 0 and 1 million." } }; filtering.ColumnSettings.Add(new ColumnFilteringSetting { ColumnIndex = i, AllowFiltering = false });
cs.ReadOnly = false; cs.EditorType = ColumnEditorType.Numeric; cs.Validation = true; cs.Required = true; cs.NumericEditorOptions = new ColumnUpdatingNumericEditorOptions { DataMode = NumericEditorDataMode.Int, MinValue = 0, MaxValue = 1000000, ValidatorOptions = new EditorValidatorOptions { KeepFocus = ValidatorKeepFocus.Always, OnBlur = true, OnChange = true, OnSubmit = true, ShowIcon = true, CustomErrorMessage = "Value must be between 0 and 1 million." } }; filtering.ColumnSettings.Add(new ColumnFilteringSetting { ColumnIndex = i, AllowFiltering = false });
Hi bobegan,
First I want to apologize for the late answer. I'm volunteer in the forums.
I was enable to reproduce your problem and it seems that you're not specifying to which column these setting should be applied.
Add this line to your code and see if it works:
Best regards,
Martin Pavlov
Infragistics, Inc.