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

Grid Columns Jumping on resize

2 Answers 336 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 01 Sep 2015, 02:44 PM
I'm having an issue with grids when I re-size the columns. If my grids have 4 or fewer columns they jump to a much larger size when you try to re-size them. This also causes the grid before them to shrink. I'm wondering if this is a column width issue or something I might be missing.

 @(Html.Kendo().Grid<DST.DTOs.CoreDTO.ClassificationTypeViewModel>()
                      .Name("ClassificationTypeGrid")
                      .ToolBar(toolBar => toolBar.Template("<a class='btn btn-primary' title='Create New' onclick='classCreateItem()' href='#'>Create Classification Type</a>"))
                      .HtmlAttributes(new { style = "height:90%" })
                      .Columns(columns =>
                      {
                          columns.Bound(p => p.Id)
                              .Width(20)
                              .Filterable(false)
                              .Sortable(false)
                              .Title("Actions")
                              .IncludeInMenu(false)
                              .ClientTemplate("<a href=\"javascript: void(0);\" onclick=\"classEditItem('#: Id #');\" title=\"Edit\"><i class=\"fa fa-pencil-square-o fa-lg\"></i>     <span class=\"sr-only\"></span></a>" +
                                              " " +
                                              "# if (timesUsed == 0) { #" +
                                              "<a href=\"javascript: void(0);\" onclick=\"confirmDeleteType('#: Id #'" + "," + "'#: Title #');\" title=\"Delete\"><i class=\"fa fa-trash-o fa-lg\"></i><span class=\"sr-only\"></span></a>" +
                                              "# } else if (timesUsed > 0) { #" +
                                              "<i class=\"fa fa-trash-o fa-lg\" title=\"Classification Type is assigned to a group\"></i>" +
                                              "# } #");
                          columns.Bound(p => p.Title)
                              .Width(100)
                              .Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
                          columns.Bound(p => p.ProtectionLevel)
                              .Width(100)
                              .Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
                      })
                      .Pageable(page => page
                          .Refresh(true)
                          .PageSizes(true))
                      .Sortable(sort => sort
                          .SortMode(GridSortMode.MultipleColumn))
                      .Scrollable(o => o.Height("100%"))
                      .Filterable(filter => filter.Mode(GridFilterMode.Row))
                      .ColumnMenu()
                      .Resizable(resizable => resizable.Columns(true))
                      .DataSource(data => data
                          .Ajax()
                          .Read("GetClassifications", "Classifications")
                      )
            )

2 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 03 Sep 2015, 05:21 AM
Hello Justin,

The observed jumping is caused by incorrect configuration. The set column widths are too small and the browser ignores them, but the widget is not aware of that. Please check the related documentation.

http://docs.telerik.com/kendo-ui/web/grid/appearance#column-widths

Regards,
Dimo
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
durby
Top achievements
Rank 1
answered on 28 Mar 2020, 10:43 PM

just add a dummy column with a width of 100%

 

 var inlineOptions = {
        dataSource: { batch: false },
        editable: { mode: "inline", createAt: createAt },
        columns: Columns.concat([{ title: "&nbsp;", width: "100%" }]),
        toolbar: ["create"]  
    };

Tags
Grid
Asked by
Justin
Top achievements
Rank 1
Answers by
Dimo
Telerik team
durby
Top achievements
Rank 1
Share this question
or