In Development
Last Updated: 05 Nov 2018 12:04 by ADMIN
ADMIN
Vessy
Created on: 15 Aug 2018 11:15
Category: Grid
Type: Bug Report
0
Hidden columns are shown on resize when the static headers and frozen column are used
Hidden columns are shown on resize when the static headers and frozen column are used.

Video: https://www.screencast.com/t/4Lwuvbp7


Possible workarounds:

- Hide the column with Visible="False", instead of Display="False"

- Hide the column on the client-side:



    function gridCreated(sender, args) {
        var masterTableView = sender.get_masterTableView();
        columnIndex = masterTableView.getColumnByUniqueName("ShipName").get_element().cellIndex;
        setTimeout(function () {
            masterTableView.hideColumn(columnIndex);
        }, 2);
    }




Steps to reproduse:

            <telerik:RadGrid RenderMode="Lightweight" HeaderStyle-Width="200px"
                AutoGenerateColumns="false"
                ID="RadGrid1"
                OnNeedDataSource="RadGrid1_NeedDataSource"
                Width="100%"
                runat="server">
                <ClientSettings>
                    <Scrolling AllowScroll="True" UseStaticHeaders="true" FrozenColumnsCount="2"></Scrolling>
                </ClientSettings>
                <MasterTableView AutoGenerateColumns="false">
                    <Columns>
                        <telerik:GridBoundColumn DataField="SongID" HeaderText="SongID" FilterControlWidth="50px" HeaderStyle-Width="50px">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="SongTitle" HeaderText="Song Title" FilterControlWidth="200px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CollectionName" HeaderText="Collection Name" FilterControlWidth="200px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn FilterControlWidth="50px" DataField="VersionID" HeaderText="VersionID" Display="false"></telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

Code Behind:

    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        (sender as RadGrid).DataSource = GetData();
    }

    private DataTable GetData()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("SongID");
        dt.Columns.Add("SongTitle");
        dt.Columns.Add("CollectionName");
        dt.Columns.Add("VersionID");

        for (int i = 0; i < 20; i++)
        {
            dt.Rows.Add(i, i + 1, i + 2, i + 3);
        }

        return dt;
    }


0 comments