Completed
Last Updated: 12 Jan 2024 15:40 by ADMIN
Release 2024 Q1
AP
Created on: 07 Dec 2023 09:10
Category: Grid
Type: Bug Report
1
Grid column header remains hidden after showing the column

Bug report

Regression introduced in R3 2023 SP1
If an initially hidden column is shown with the showColumn API method, the column header remains hidden because of the k-hidden class that remains in the th element.

Reproduction of the problem

  1. Click on the button above the Grid in the example below
<input type="button" name="btn1" value="Show the hidden columns" onclick="btn1Click()" />
<br />
<br />

@(Html.Kendo().Grid<TelerikMvcApp1.Models.OrderViewModel>()
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.OrderID);
        columns.Bound(p => p.Freight);
        columns.Bound(p => p.ShipName);
        columns.Bound(p => p.ShipCity).Hidden(true);
        columns.Bound(p => p.OrderDate).Format("{0:MM/dd/yyyy}").Hidden(true);
    })
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)
        .Read(read => read.Action("Orders_Read", "Grid"))
    )
)

<script>
    function btn1Click() {
        var grid = $("#Grid").data("kendoGrid");

        grid.showColumn("ShipCity");
        grid.showColumn("OrderDate");
    }
</script>

Current behavior

The hidden columns are shown but their headers remain hidden.

As a workaround, the k-hidden class can be removed from the column header, after showing the column:

grid.showColumn("ShipCity");
$(".k-grid .k-header[data-field='ShipCity']").removeClass("k-hidden");

Expected/desired behavior

The columns and their headers are shown.

Environment

  • Kendo UI version: 2023.3.1114
  • jQuery version: x.y
  • Browser: [all ]
2 comments
ADMIN
Ivan Danchev
Posted on: 12 Jan 2024 15:40

Christopher,

I am not reproducing the issue with the ColumnMenu. Here's a REPL example that has a Grid with a ColumnMenu configured: https://netcorerepl.telerik.com/meulFwPT35OpVN7F35 

The ShipCountry column is hidden. Showing the ShipCountry column through the ColumnMenu or hiding another column and then showing it works as expected at my end.

Are you able to reproduce the problem in the linked example? If so, could you list step by step the user actions that lead to the problematic behavior being exhibited?

Regards,
Ivan Danchev
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.

Christopher
Posted on: 05 Jan 2024 18:48
I am having the same issue, but I am using the ColumnMenu show/hide.  What would be the solution for that?