Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
830
Pivot Grid column width
posted

hi,

I am using pivot Grid in our application. Is it possible to set custom width per each column for pivot grid?

for now i use 

gridOptions : {

        defaultColumnWidth: 80}

but i need to set different width for different columns

Parents
  • 23953
    Offline posted

    Hello,

    You can manipulate the grid column collection in the dataRendering event. Here is a code snippet.

    $("#pivotGrid").on("iggriddatarendering", function (evt, ui) {

    // return if the column collection is not generated yet

    if (ui.owner.options.columns && ui.owner.options.columns.length === 0) {

    return;

    }

    ui.owner.options.columns[0].width = "50px";

    });

    Please note that since the data is dynamic there is no good way that you identify what data is in the column.
    I'm attaching a working sample. You can see that when expanding "All Sellers" the "Stanley Brooker" column is with width "50px".

    Best regards,
    Martin Pavlov
    Infragistics, Inc.

    igPivotGrid_column_width.zip
Reply Children
No Data