How to make a colum not resizable ?

1 Answer 59 Views
Grid
serge
Top achievements
Rank 2
Bronze
Iron
Iron
serge asked on 25 May 2022, 12:47 PM

Is there a way for ASP.NET Core grid to mark a column as NOT resizable? I mean, no way to resize that column, even if others are able to resize?

Please see this thread on SO.

The proposed solution should work does not matter is that column bound to a data or not, is the column last or first or not. Especially the case when the column is the last one and is a command column. Often such columns are of fixed length, cause buttons or commands are fixed. The actions column should not be moved or resized. However, if the column is pushed by others, the column could go out of the visible view. 

1 Answer, 1 is accepted

Sort by
0
Aleksandar
Telerik team
answered on 30 May 2022, 05:52 AM

Hello Serge,

Would using a sticky column be an option in the scenario you have? Locked columns in the Grid are rendered on the left side of the Grid, where the sticky columns are displayed in the scrollable area with the non-frozen columns. Setting a width for the last column, MinResizableWidth and setting is the command column as sticky will make the column always visible on the right hand-side of the Grid. Here is a REPL with an example.

columns.Command(c=>c.Edit()).Width(150).MinResizableWidth(150).Sticky(true).HeaderHtmlAttributes(new{@class="myCommandCellColumn"});

Also the above example demonstrates how you can add a class to the Header cell and identify if, instead of using the data-field options as suggested in the knowledgebase article.

Regards,
Aleksandar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
serge
Top achievements
Rank 2
Bronze
Iron
Iron
Answers by
Aleksandar
Telerik team
Share this question
or