I have a grid that is dynamically built cell by cell. Each row contains a Label cell, a operator cell(=,<>, >, etc.), and a value column. The value column can be a string, number, date, etc. As I build the grid I am setting the
Grid.Rows(Count).Cells("EditValue").Column.MinValue to a number
Grid.Rows(Count).Cells("EditValue").Column.MaxValue to a number
However the value is not being validated or maintained in the BeforeCellDeactivate event. When I check the Grid.ActiveCell.Column.MinValue it is not what I set it too.
Any ideas how to validate a cells input against a min/max value?
The MinValue and MaxValue are on the column, not the cell. The Column property of the cell is simply a backward pointer to the Column to which the cell belongs. There's no way to set a MinValue/MaxValue on an individual cell basis.
Perhaps what you could do is add a couple more columns for MinValue and MaxValue. You can hide these columns using the Hidden property. Then you can use BeforeCellUpdate to validate the data in the value cell against the MinValue and MaxValue cells in the same row.