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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Custom Column Widths

Thread ID:

Created:

Updated:

Platform:

Replies:

146607 Aug 9,2019 09:56 PM UTC Aug 21,2019 12:19 PM UTC JavaScript - EJ 2 4
loading
Tags: PivotView
Jay Velasco
Asked On August 9, 2019 09:56 PM UTC

Hello,

Is it possible to set the column widths before the pivot table loads? Looking for a setting, but cannot find. 

Best,
Jay

Jay Velasco
Replied On August 9, 2019 10:18 PM UTC

Answered my own question - there's the grid property in the pivot view. Can change the width and call the refreshColumns method. 

Scintilla Arul Jothi Raj [Syncfusion]
Replied On August 12, 2019 04:23 AM UTC

Hi Jey,

Thanks for contacting Syncfusion support. Please find the response below.

 

You can change the coumnWidth of pivot table in the enginePopulated event. Please find the code snippet below.

 

Code snippet:[JavaScript]

enginePopulated: function (args) {

        this.gridSettings.columnWidth = 210;

    }

 

Sample link: https://stackblitz.com/edit/ptwcmh?file=index.ts

 

Please let us know if you have any concerns.

 

Regards,

Scintilla A


Ajay Gohil
Replied On August 20, 2019 04:18 AM UTC

Try this code for set width of in kendo grid columns 
 columns: [ {
                        field: "OrderID",
                        title: "Order ID",
                        width: 150
                    }
                ]

Scintilla Arul Jothi Raj [Syncfusion]
Replied On August 21, 2019 12:19 PM UTC

Hi Ajay, 

Thanks for the update. 

You can set width for specific columns of pivot table by using the event columnRender under the property gridSettings. 

Please find the following code snippet for your reference. 

Code snippet: [JavaScript] 
gridSettings: {   
          columnRender: function(args) { 
            for(var i=0; i < args.columns.length; i++) { 
            if(args.columns[i].headerText != undefined && args.columns[i].headerText.indexOf("Units Sold")> 0) 
                args.columns[i].width =210; // You can customize the width of specific column here. 
            } 
        }  
        } 
 
Screenshot: 
 
Note: You can only set width to the columns of the last row (Units Sold, Sold Amount etc..) of column axis. Based on its column width its parent column(Q1, Q2, FY 2015 etc..) width will be calculated. 
 
Please let us know if you have any concerns. 

Regards, 
Scintilla A 


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.

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

Live Chat Icon For mobile
Live Chat Icon