Hello.
I know that the MinValue and MaxValue can be set on a column level, but how do you set it on a cell level?
I've managed a workaround by setting those properties on the column in the "BeforeEnterEditMode" event, but I'm not sure that that's the best way (see code, below).
Is there a better way?
Thanks in advance,
Mike
ugIncludedItems.BeforeEnterEditMode
ugIncludedItems.ActiveCell.Column.MaxValue =
).Value)
ugIncludedItems.ActiveCell.Column.MinValue = 0
Sub
I'm pretty sure this will not work.If I am wrong, then it would certainly only work once you set the UserEditorMaskProperties on the column to true. But I suspect the MinValue and MaxValue cannot be set on a single cell.
You could, of course, trap the BeforeCellUpdate event and validate the value against whatever you want.
Hello,
If you are following this approach you are setting MinValue and MaxValue on the column level and not on the cell level.
So you probably have to remove the style of the column and set an editor with the appropriate settings on each cell in the IntializeRow event like :
Private Sub ultraGrid1_InitializeRow(sender As Object, e As InitializeRowEventArgs) Dim unE As New UltraNumericEditor() e.Row.Cells("DesiredColumn").EditorComponent = unE unE.SpinButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.OnMouseEnter unE.MaxValue = e.Row.Cells("MaxValueColumn").ValueEnd Sub
Please let me know if you have any further questions.