We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid column minWidth property doesn't work

The grid column minWidth property doesn't seem to have any effect (width property works fine).


1 Reply

RR Rajapandi Ravi Syncfusion Team March 24, 2023 01:38 PM UTC

Hi Rob,


Greetings from Syncfusion support


We have checked your query and we could see that you are facing the problem with min-width. Based on your query we have prepared a sample and tried to reproduce your reported problem at our end but it was unsuccessful. The min-width was applied properly while resizing the column. Please refer the below code example and sample for more information.


 

let grid: Grid = new Grid(

        {

            dataSource: orderDetails,

            allowResizing: true,

            height: 400,

            width: 850,

            columns: [

                { field: 'OrderID', headerText: 'Order ID', minWidth: 100, width: 150, maxWidth: 200, textAlign: 'Right' },

                { field: 'CustomerName', headerText: 'Customer Name', minWidth: 100, width: 150 },

                { field: 'Freight', width: 120, format: 'C2', minWidth: 8, textAlign: 'Right' },

                {

                    field: 'ShippedDate', headerText: 'Shipped Date', minWidth: 8,

                    width: 150, format: 'yMd', textAlign: 'Right', allowResizing: false

                },

                { field: 'ShipCountry', headerText: 'Ship Country', minWidth: 8, width: 150 }

            ]

        });

    grid.appendTo('#Grid');

 


Sample: https://stackblitz.com/edit/ekfsx6?file=index.ts


If you still face the issue, please share the below details that would be helpful for us to provide better solution.


1)      Share your syncfusion package version.


2)      Share your complete Grid rendering code.


3)      Please share at what use case scenario you are facing the problem with min-width property.


4)      If possible, please try to reproduce the issue with our above attached sample or share any issue reproducible sample.


Regards,

Rajapandi R


Loader.
Live Chat Icon For mobile
Up arrow icon