Column re-size and restoring original widths

4 posts, 0 answers
  1. Greg
    Greg avatar
    18 posts
    Member since:
    Nov 2012

    Posted 14 Mar Link to this post

    If the grid column re-size is enabled and the user re-sizes one or more column in the grid. Is there any way to restore those column sizes automatically later? I've found several posts on the subject but none seem to work.

    The last attempt was made using the "element" object to restore the grid column sizes:

    $("#grid-id .k-grid-header-wrap").find("colgroup col").eq(xx).width(yy);
    $("#grid-id .k-grid-content").find("colgroup col").eq(xx).width(yy);

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 15 Mar Link to this post

    Hello,

    You can see the thread below for more information o n how to keep and restore the resizable column width later on:
    http://stackoverflow.com/questions/20379967/kendo-grid-resizable-column-width

    Regards,
    Maria Ilieva
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Greg
    Greg avatar
    18 posts
    Member since:
    Nov 2012

    Posted 15 Mar in reply to Maria Ilieva Link to this post

    I looked at the article in above and it doesn't appear to have any solutions. I'm not looking to tie into the "columnResize" event. By then it's too late. What I'm looking for is a means to reset all the column width in the grid UI back to their original size.

    The post below does not work:

    Your code doesn't trigger columnResize event, but binds columnResize event handler instead. Anyway, triggering the event doesn't help, probably because the event itself is generating by the resize handle after it really resized the column. The code below triggers the event, but it doesn't help: g = $('#grid') gg = g.getKendoGrid() gg.trigger('columnResize',{column:gg.columns[1],oldWidth:gg.columns[1].width,new‌Width:400,sender:gg}) (don't know, why the code is not formatting as described in the help) – nnseva

  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 18 Mar Link to this post

    Hello Greg,

    Now I understand your requirement and would suggest you to revise the example below that demonstrates a possible approach for achieving the required functionality:
    http://jsfiddle.net/OnaBai/a9QSr/


    Regards,
    Maria Ilieva
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET MVC is VS 2017 Ready