diff --git a/components/DataTable/src/DataTable/DataTable.cs b/components/DataTable/src/DataTable/DataTable.cs index 039e0e8bf..f42df3e50 100644 --- a/components/DataTable/src/DataTable/DataTable.cs +++ b/components/DataTable/src/DataTable/DataTable.cs @@ -96,8 +96,7 @@ protected override Size MeasureOverride(Size availableSize) // Avoid negative values when columns don't fit `availableSize`. Otherwise the `Size` constructor will throw. double width = availableSize.Width - fixedWidth - autoSized; - if (width < 0) - width = 0; + width = Math.Max(width, 0); column.Measure(new Size(width, availableSize.Height)); // Keep track of already 'allotted' space, use either the maximum child size (if we know it) or the header content