resizeToFit(), resizeColumn() and HeaderStyle.Width incompatible?

5 posts, 0 answers
  1. Greg
    Greg avatar
    17 posts
    Member since:
    Oct 2013

    Posted 20 Dec 2013 Link to this post

    Hello,

    I am working on a grid with some columns have the width automatically adjusted, some others adjusted by resizeToFit() and some other the width is fixed by HeaderStyle.Width.

    If there is a column re sized by  resizeToFit(), all the following columns' width with HeaderStyle.Width are not respecting this parameter. The columns before the one re sized to fit work well.

    Also if I use resizeToFit() and resizeColumn(index,width) (not using HeaderStyle.Width in this case), only resizeColumn is applied (placed after resizeToFit() in the script).

    Could please explain how can they all get along together?
    Thank you
    Gregory


  2. Greg
    Greg avatar
    17 posts
    Member since:
    Oct 2013

    Posted 23 Dec 2013 Link to this post

    I would like to add another behavior that I just noticed.
    Let's take an example with a grid with 10 columns in which some columns are defined with HeaderStyle.Width. The grid allows the users to resize columns. If the user re sizes a column, all the columns coming after lose their initial width.

    I am guessing it is a normal behavior. Is there any documentation about all of this please?

    Thank you
    Gregory

  3. Vasil
    Admin
    Vasil avatar
    1635 posts

    Posted 26 Dec 2013 Link to this post

    Hi Greg,

    If you want to resize column, without affecting the rest columns then the whole width of the grid will be affected. You could achieve this by setting ClientSettings -> Resizing -> ResizeGridOnColumnResize = true.

    Additionally see this demo and the related resources to the demo for more information:
    http://demos.telerik.com/aspnet-ajax/grid/examples/columns-rows/columns/column-row-resize-reorder/defaultcs.aspx

    Regards,
    Vasil
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  4. Greg
    Greg avatar
    17 posts
    Member since:
    Oct 2013

    Posted 26 Dec 2013 Link to this post

    Hello Vasil,

    Thank you for you answer.

    In this example:
    +-----------------+-----------+-----------------+-----------+
    |            A         |       B      |           C         |      D       |
    +-----------------+-----------+-----------------+-----------+

    The grid is adjusted to the screen width and expands automatically. Columns B and C are fixed to 50px with HeaderStyle.Width. A and C are automatically adjusted.

    Is it possible to have the column C adjusting automatically when the user adjusts the column A? since B and C have been defined ?

    I am guessing no according to your previous answer, I just wanted to confirm.

    Thank you again



  5. Antonio Stoilkov
    Admin
    Antonio Stoilkov avatar
    530 posts

    Posted 02 Jan 2014 Link to this post

    Hi Greg,

    You are correct in your observations. There is no way to automatically adjust the C column white the A column adjusts. If you have any additional questions related to RadControls please do not hesitate to contact us again.

    Regards,
    Antonio Stoilkov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top