When the MinimumHeight gets changed to a value less than Height
we set height to the new minimum height (and fire the
DataGridView.RowMinimumHeightChanged event). This matches the
behavior on .NET.
When the user tries to set Height to a value less than MinimumHeight
we silently set the height to the minimum height (instead of
throwing an exception). This matches also the behavior on .NET.
if (height != value) {
if (value < minimumHeight) {
- throw new ArgumentOutOfRangeException("Height can't be less than MinimumHeight.");
+ height = minimumHeight;
+ } else {
+ height = value;
}
- height = value;
if (DataGridView != null) {
DataGridView.Invalidate ();
DataGridView.OnRowHeightChanged(new DataGridViewRowEventArgs(this));
if (value < 2 || value > Int32.MaxValue) {
throw new ArgumentOutOfRangeException("MinimumHeight should be between 2 and Int32.MaxValue.");
}
+ if (height < value) {
+ // don't let height get less than minimumHeight!
+ Height = value;
+ }
minimumHeight = value;
if (DataGridView != null) {
DataGridView.OnRowMinimumHeightChanged(new DataGridViewRowEventArgs(this));