Strange behavior on resizing column in case last column has fixed size

4 posts, 0 answers
  1. Anatoliy
    Anatoliy avatar
    37 posts
    Member since:
    Oct 2012

    Posted 11 Aug Link to this post

    Hi Telerik,

         I have using GridView with some text columns and button column as last one.

         Text's columns are resizable with minimum size declared. Button's column is non-resizable and must stay right-side pinned.

         Additionally, I need prevent horizontal scroll bar appearing.

         So strange behavior is when resize splitter between last text's and button's columns in left direction - text's column narrowing to it's minimum width and after that previous left column do the same.

          Please, suggest how to prevent that? 

     

    With regards, Anatoliy

        

  2. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    370 posts

    Posted 15 Aug Link to this post

    Hello Anatoliy,

    This issue is observed due to the fact that the column resize gripper is shared between the two columns and sliding it results in decreasing the size of the star-based width column.

    There is a feature request in our feedback portal for the introduction of a second gripper to handle the resize of columns separately and you can vote for in order to raise its priority.

    A workaround you can use for the moment is to handle RadGridView's ColumnWidthChanging event, check if the column being resized is the one preceding the button column and cancel the resizing if the drag direction is left (the HorizontalChangeWidth is negative).

    private void ClubsGrid_ColumnWidthChanging(object sender, ColumnWidthChangingEventArgs e)
    {
        if (e.Column.Name == "Established" && e.HorizontalChangeWidth.Value <= 0)
        {
            e.Cancel = true;
        }
    }

    Please let me know if such an approach would be suitable for you.

    Regards,
    Dilyan Traykov
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Anatoliy
    Anatoliy avatar
    37 posts
    Member since:
    Oct 2012

    Posted 17 Aug in reply to Dilyan Traykov Link to this post

    Hi Dilyan,

         It's not a good idea to prevent resizing previous column, cause I step into next problem with your code (raise-case): column content overflows its cell width.

     

    With regards, Anatoliy

     

  5. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    370 posts

    Posted 18 Aug Link to this post

    Hello Anatoliy,

    I'm afraid that this is the only workaround I can offer you at the moment.

    Another approach you can take in order to avoid this behavior would be to simply set the IsResizable property of all columns to False, should you find it applicable.

    Regards,
    Dilyan Traykov
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top