This is a migrated thread and some comments may be shown as answers.

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

3 Answers 48 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Anatoliy
Top achievements
Rank 2
Anatoliy asked on 11 Aug 2016, 08:11 AM

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

    

3 Answers, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 15 Aug 2016, 01:30 PM
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.
0
Anatoliy
Top achievements
Rank 2
answered on 17 Aug 2016, 02:37 PM

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

 

0
Dilyan Traykov
Telerik team
answered on 18 Aug 2016, 11:19 AM
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.
Tags
GridView
Asked by
Anatoliy
Top achievements
Rank 2
Answers by
Dilyan Traykov
Telerik team
Anatoliy
Top achievements
Rank 2
Share this question
or