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

Disable resize for specific column?

1 Answer 1387 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 22 Jan 2013, 02:36 PM

Is there a way to disable column resizing for a particular column only (the last column to be precise)?

Some more info on my problem, I have enabled fixed table layout on the Grid, so that an Ellipsis will show for fields that are very long.

/*  allow ellipsis to show on overflow text in grid */
.k-grid table
{
   table-layout:fixed;
}

... but now when the user resizes the last column, there are rendering issues on the Grid - it overruns the width of the grid (see attachment).

Here is my grid def -

       @(Html.Kendo().Grid(Model)
                .Name("Grid")
                .Columns(columns =>
                {
                    columns.Bound(p => p.RoleName).Width(200);
                    columns.Bound(p => p.Description);
                })
                .Events(events => events.Change("Grid_OnRowSelect"))
                .Pageable()
                .Sortable()
                .HtmlAttributes(new { @style = "width:500px" })
                .Selectable(s => s.Mode(GridSelectionMode.Single))
                .Resizable(resize => resize.Columns(true))
                .DataSource(dataSource => dataSource
                    .Ajax()
                        .Read(read => read.Action("RoleSearch", "Role").Data("Grid_OnData"))
                        .Events(e => e.RequestEnd("Grid_OnRequestEnd"))
                    )

            )

1 Answer, 1 is accepted

Sort by
-1
Dimiter Madjarov
Telerik team
answered on 24 Jan 2013, 03:34 PM
Hi Andy,

This is a quote from my answer on the same topic in your Ticket thread:

Disabling the resizing of only one column is not supported by default. I can suggest you the following workaround - you could attach to the columnResize event and each time the column is resized, just return it's width to the previous value. Here you could see a JsBin example of the described approach - Disable Grid Resizing Example.
 


Kind regards,
Dimiter Madjarov
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
serge
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 24 May 2022, 06:01 PM

is a shame you could not propose such a elementary way to disable the resize, once you allowed to enable it, especially for the Server side programming we should switch and "hack" events for such a simple need
Yanislav
Telerik team
commented on 26 May 2022, 10:30 AM

Hello Serge, 

You are right, currently the Grid does not expose a built-in configuration that allows specifying if a column should be resizeable or not. If you find this a reasonable feature, I encourage you to log a feature request in our Feedback Portal.

If you decide to log it, please elaborate more on how you envision this functionality to work. Alternatively, we can log it on your behalf.

The feature requests logged in the portal are reviewed and, based on the interest the community shows in them, they are planned accordingly for implementation in subsequent releases.
Tags
Grid
Asked by
Andy
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or