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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Vertical Header Width of Column

Thread ID:





128617 Feb 1,2017 12:32 PM UTC Feb 16,2017 12:13 PM UTC ASP.NET MVC 5
Tags: Grid
indrani Gajjarapu
Asked On February 1, 2017 12:32 PM UTC


I attached a script and the grid image with vertical headers.

I want to set the width of each column according to the cell content.

Can you give me a workaround for this please.

Thank you

Mani Sankar Durai [Syncfusion]
Replied On February 2, 2017 11:13 AM UTC

Hi Indrani, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and we suggest you to enable AllowResizeToFit property which helps to set the column width inbuilt based on its cell content. So it is not necessary to set the width for the columns explicitly.  
Refer the below code example. 
                             .AllowResizeToFit()       //set the column width based on its content 
                          .Columns(col => 

Also you have mentioned that you are using like vertical headers. 

So please refer the following KB and documentation link. 

If you face any difficulties please share the following details, 
1.       Share the screenshot/video of the issue you have faced. 
2.       Share the full grid code. 
3.       Share the sample with issue reproducing. 
The provided information will help us to analyze the issue and provide you the response as early as possible. 

Please let us know if you need further assistance. 

Manisankar Durai 

indrani Gajjarapu
Replied On February 6, 2017 11:41 AM UTC


Thanks for your reply.

"AllowResizetoFit" works to some extent. However as mentioned in the documentation, the column width is set automatically based on content or header text text which is large. But my requirement is to set width only by content but not header text.

Please find the picture attached as an example.



Attachment: pic_3d60cb34.zip

Prasanna Kumar Viswanathan [Syncfusion]
Replied On February 7, 2017 06:12 PM UTC

Hi Indrani, 

If you need to set column width based on content only, enable the AllowTextWrap property and wrapMode as header in textWrapSettings API of ejGrid. The allowTextWrap  property is used to wrap the content to the next line if the content exceeds the column. In this when we set the wrapMode as header then the auto wrap will be set only for header. 

Find the code example:  

   .TextWrapSettings(e => e.WrapMode(WrapMode.Header)) 
   .Columns(col => 

Refer to the Help document. 

Prasanna Kumar N.S.V

indrani Gajjarapu
Replied On February 15, 2017 02:13 PM UTC

Hi Prasanna Kumar,

Thanks for your reply.

I did apply those settings but they didn't completely solve the issue.

I have attached a sample project below.

Thank you.


Attachment: ColumnWidth_d2ea486b.7z

Mani Sankar Durai [Syncfusion]
Replied On February 16, 2017 12:13 PM UTC

Hi Indrani, 
A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.  

Manisankar Durai. 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon