lastunicorn / ConsoleTools

A set of tools and "controls" for the .net Console.
GNU General Public License v3.0
73 stars 5 forks source link

DataGrid - MaxWith is ignored #46

Closed lastunicorn closed 2 months ago

lastunicorn commented 3 years ago

When smaller MaxWidth is set on a grid than its natural width, the value is ignored.

Step 1: Create a DataGrid with a text column containing 50 characters. Step 2: Set the MaxWidth to 30. Expected: The width of the rendered DataGrid should be 30. Actual: The width of the rendered DataGrid is 54 (50 plus the paddings and borders).

Example: A table like this:

┌────────────────────────────────────────────────────┐
│ Table without colors                               │
├────────────────────────────────────────────────────┤
│ Text                                               │
├────────────────────────────────────────────────────┤
│ Generic types can have multiple generic parameters │
└────────────────────────────────────────────────────┘

When applying a MaxWidth of 30 on it, is expected to be rendered like this:

┌────────────────────────────┐
│ Table without colors       │
├────────────────────────────┤
│ Text                       │
├────────────────────────────┤
│ Generic types can have     │
│ multiple generic           │
│ parameters                 │
└────────────────────────────┘