[CLOSED] Grid column header is not showing when Text is EMPTY

  1. #1

    [CLOSED] Grid column header is not showing when Text is EMPTY

    Hi,
    In Ext.Net 4.5 v, if grid has a single column and it's Text is empty, the header is NOT showing, what could be the reason and how to solve this? We need a clickable header with NO Text or Empty Text.
    The same was worked in Ext.Net 2.5 version.
    <%@ Page Language="C#" %>
    
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.GridPanel1.Store.Primary.DataSource = new object[]
                {
                    new object[] { true, DateTime.Now, 1 },
                    new object[] { false, DateTime.Now.AddDays(-1), 2 },
                    new object[] { true, DateTime.Now.AddDays(-2), 3 },
                    new object[] { false, DateTime.Now.AddDays(-3), 4 },
                    new object[] { true, DateTime.Now.AddDays(-4), 5 }
                };
    
    
                this.GridPanel1.Store.Primary.DataBind();
            }
        }
    </script>
    
    
    <!DOCTYPE html>
    
    
    <html>
    <head runat="server">
        <title>Columns Variations - Ext.NET Examples</title>
        <link href="/resources/css/examples.css" rel="stylesheet" />
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
    
            <ext:GridPanel
                ID="GridPanel1"
                runat="server"
                Title="Column Variations"
                DisableSelection="true"
                Width="600"
                Height="350">
                <Store>
                    <ext:Store runat="server">
                        <Model>
                            <ext:Model runat="server">
                                <Fields>
                                    <ext:ModelField Name="booleanCol" Type="Boolean" />
                                    <ext:ModelField Name="dateCol" Type="Date" />
                                    <ext:ModelField Name="numberCol" Type="Int" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server" ColumnsText="Test">
                    <Columns>
                        <ext:Column runat="server" Text="" EmptyCellText="test">                       
                        </ext:Column>
                    </Columns>
                </ColumnModel>
                <View>
                    <ext:GridView runat="server" StripeRows="true" />
                </View>
            </ext:GridPanel>
        </form>
    </body>
    </html>
    Last edited by fabricio.murta; Sep 26, 2018 at 5:42 PM.
  2. #2
    Hello @iansriley!

    Indeed, if all column grids' text are empty, an "auto hide headers" grid feature kicks in and hides the header at all... But I would agree with you that this could kill column sorting, title menus, and a series of other functionalities.

    Although not native support is implemented to it, there's a quick way to completely disable this whole functionality in a given grid panel context:

    <%-- By design, it will auto-ride headers if all headers on the grid have no text. --%>
    <CustomConfig>
        <ext:ConfigItem Name="shouldAutoHideHeaders" Value="function() { return false; }" Mode="Raw" />
    </CustomConfig>
    This will always tell the grid panel it should not automatically hide columns' headers. This is kind of an edge case, I'm not sure that would be worth a feature request to implement this as a config option given the ease to overcome this default behavior, but your opinion on the matter would be greatly appreciated.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Sorry for the late reply, the suggested solution is working fine, you can close this thread.
    Thank you
  4. #4
    Thanks for the feedback, glad it helped!
    Fabrício Murta
    Developer & Support Expert
  5. #5
    One Question: why i am not seeing create a "New Thread" option for my account??
  6. #6
    Hello, @iansriley!

    It seems your premium subscription has expired; or the forum account has not properly been synced with your subscription. Please drop us a mail at hello@ext.net if you think that's wrong.

    Without premium subscription you still can make new threads in any community forums.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] Change Grid column header text in Javascript
    By Z in forum 3.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 04, 2015, 11:48 PM
  2. Replies: 4
    Last Post: Nov 11, 2014, 6:18 PM
  3. [CLOSED] Not showing header of a grid
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 26, 2012, 11:56 AM
  4. [CLOSED] Column header text style
    By Stefanaccio in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 03, 2011, 11:03 AM
  5. grid empty text
    By [WP]joju in forum 1.x Help
    Replies: 3
    Last Post: Sep 28, 2009, 11:38 AM

Tags for this Thread

Posting Permissions