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

Minimum Column Width.

Hi,
When omitting the width specification for a grid column, the column automatically resizes to fill the rest of the window.  This behavior is what I'm looking for.  However, when the window containing the grid becomes too small, these dynamically sized columns completely disappear.  This is causing problems for some of my users with smaller monitors.  Is there a way to set the minimum width on a column but still have it resize with the window?  Thanks.

1 Reply

RR Ranjithkumar R G Syncfusion Team June 13, 2012 04:40 AM UTC

Hi Kenneth,

 

Thanks for using Syncfusion products.

 

Your requirement of setting column width to specific column and resizing the grid according to window can be achieved by setting column width for specific columns and setting the EnableScroll. Please refer to the code snippet below to achieve this.

 

[ASPX]

 

      @{Html.Syncfusion().Grid<Order>("SampleGrid")

                    .Datasource(Model)

                    .Caption("Orders")

                    .Column(col =>

                    {

                        col.Add(c => c.OrderID).Width(50);

                        col.Add(c => c.EmployeeID).Width(50);

                        col.Add(c => c.CustomerID).Width(80);

                        col.Add(c => c.OrderDate).Width(100);                   

                        col.Add(c => c.ShipCountry).CellEditType(CellEditType.DropdownEdit).Width(60);

                        col.Add(c => c.Freight).Width(50);

 

                    })

                

                  .EnableScrolling() 

                  .EnablePaging()

 

Please let us know if you have any concern.

 

Regards,

Ranjithkumar.


Loader.
Live Chat Icon For mobile
Up arrow icon