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

Grid Column Width - TagHelper

Thread ID:

Created:

Updated:

Platform:

Replies:

129691 Mar 28,2017 10:32 PM UTC Mar 29,2017 04:54 AM UTC ASP.NET Core 1
loading
Tags: Grid
Andy Watt
Asked On March 28, 2017 10:32 PM UTC


Hi

How do I set a column width in pixels?  I believe the column tag helper is defaulting to percentages.

I would like to use a mix of pixel and percentage widths.

Eg

<e-column field="email" header-text="Email" text-align="Left" width="45"></e-column>

Thanks, Andy

Venkatesh Ayothi Raman [Syncfusion]
Replied On March 29, 2017 04:54 AM UTC

Hi Andy, 
Thanks for contacting Syncfusion support. 
We can give column width in mix of pixel and percentage like as follows, 
Code example
@Grid 
 
<ej-grid id="FlatGrid" datasource="@ViewBag.child" allow-paging="true>         
    
    <e-columns> 
        <e-column field="OrderID" is-primary-key="true" header-text="Order ID" text-align="Right" width=@("60px")></e-column> 
        <e-column field="CustomerID" header-text="Customer ID" width=@("80px")></e-column> 
        <e-column field="EmployeeID" header-text="Employee ID" allow-editing="false" text-align="Left" width=@("20%")>        
        </e-column> 
        <e-column field="Freight" header-text="Freight" edit-type="Numeric" format="{0:C2}" width=@("15%")> 
            <e-numeric-edit-options decimal-places="4"></e-numeric-edit-options> 
        </e-column> 
          
    </e-columns> 
</ej-grid> 

Regards, 
Venkatesh Ayothiraman. 


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.

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

;