Grid Column Width - TagHelper


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

1 Reply

VA Venkatesh Ayothi Raman Syncfusion Team 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. 


Loader.
Up arrow icon