Hide all headers in RadGrid (when using ItemTemplate)

4 posts, 0 answers
  1. Cartoon Head
    Cartoon Head avatar
    21 posts
    Member since:
    Apr 2010

    Posted 01 Jul 2010 Link to this post

    I am using a RadGrid to list a bunch of records using an ItemTemplate format, but want to hide the fact that it is actually a grid.

    Right now, all the headers are visible, including those for columns not being included in the ItemTemplate.

    I'm sure I am just missing a simple setting, but I can't find it.  How do I hide the headers altogether?
  2. Cartoon Head
    Cartoon Head avatar
    21 posts
    Member since:
    Apr 2010

    Posted 01 Jul 2010 Link to this post

    Never mind.  I found it:

        <MasterTableView   
                DataSourceID="sqlIdeal"   
                    ShowHeader="false" 
                    TableLayout="Fixed" > 
     

    I hate it when it's that obvious!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 01 Jul 2010 Link to this post

    Hello Cartoon,

    You can hide or show the header element using the grid's ShowHeader property. For more information about headers, see Using columns.

    Best wishes,
    Pavlina
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  5. <span>w</span>
    <span>w</span> avatar
    84 posts
    Member since:
    Jun 2012

    Posted 26 Aug 2013 Link to this post

    How to hide header on specific column in Radgrid in javascript?
    I don't want to use table.hideColumn(column.get_element().cellIndex);

     function PrintRadGrid() {
                    var radGrid = $find('<%= RadGrid1.ClientID %>');
                    var table = radGrid.get_masterTableView();
                    var column = table.getColumnByUniqueName("CkboxDelKey");
                    
                    var masterTable = $find("<%=RadGrid1.ClientID%>").get_masterTableView();
                    for (var row = 0; row < masterTable.get_dataItems().length; row++) {
                        var str = masterTable.getCellByColumnUniqueName(masterTable.get_dataItems()[row], "CkboxDelKey").innerHTML;
                        if (str.indexOf("<nobr>") != -1) {
                            masterTable.getCellByColumnUniqueName(masterTable.get_dataItems()[row], "CkboxDelKey").style.display = 'none';
                        }
                    }

    //hide header code
    //Code here

    }
Back to Top