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.
Unfortunately, activation email could not send to your email. Please try again.

Minimum Column Width.

Thread ID:

Created:

Updated:

Platform:

Replies:

103880 Jun 6,2012 12:21 PM Jun 13,2012 12:40 AM ASP.NET MVC (Classic) 1
loading
Tags: Grid
Kenneth Lam
Asked On June 6, 2012 12:21 PM

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.

Ranjithkumar R G [Syncfusion]
Replied On June 13, 2012 12:40 AM

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.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;