Filter gone when header is suppressed

7 posts, 0 answers
  1. Adam
    Adam avatar
    177 posts
    Member since:
    Oct 2012

    Posted 24 Jun 2008 Link to this post

    I have a rad grid where I have the header turned off but I have the Allow Filtering By Column enabled. However, when the header is turned off, the filtering is also gone and the user cannot use it. Is there anyway to show the filtering, but hide the header?

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 25 Jun 2008 Link to this post

    Hi Adam,

    Try setting the HeaderText property as empty instead of setting the ShowHeader property to false.

    <telerik:GridBoundColumn DataField="ProductName"   HeaderText="" SortExpression="ProductName" ></telerik:GridBoundColumn> 

  3. Adam
    Adam avatar
    177 posts
    Member since:
    Oct 2012

    Posted 27 Jun 2008 Link to this post

    Unfortunately, that doesn't work. Here is the definition for the table of what I'm using. The header still displays and rows appear all scrunched up to the point where you can't see them at all.

    <telerik:RadGrid ID="grdDom" runat="server" AutoGenerateColumns="False" Width="300px" 
                            Height="300px" GridLines="None" AllowMultiRowSelection="True" AllowPaging="True" 
                            <pagerstyle mode="Slider" /> 
                            <mastertableview datakeynames="DDID,Editable" showheader="False" borderwidth="0px">  
    <RowIndicatorColumn Visible="False">  
    <HeaderStyle Width="20px"></HeaderStyle> 
    <ExpandCollapseColumn Visible="False" Resizable="False">  
    <HeaderStyle Width="20px"></HeaderStyle> 
    <telerik:GridClientSelectColumn HeaderText="Include" UniqueName="Include">  
    <HeaderStyle Width="12%"></HeaderStyle> 
    <telerik:GridBoundColumn DataField="Domain" HeaderText="Domain" UniqueName="column1">  
    <HeaderStyle Width="88%"></HeaderStyle> 
    <PopUpSettings ScrollBars="None"></PopUpSettings> 
    <ItemStyle Wrap="False" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False"></ItemStyle> 
    <GroupHeaderItemStyle Wrap="False" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False"></GroupHeaderItemStyle> 
    <AlternatingItemStyle Wrap="False" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False"></AlternatingItemStyle> 
    <EditItemStyle Wrap="False" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False"></EditItemStyle> 
    <Selecting AllowRowSelect="True"></Selecting> 
    <ClientEvents OnRowSelecting="RowSelecting"></ClientEvents> 
    <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling> 
     In this example the header is still off and the filtering is off as well. But I enabled both and got the problems I noted above.
  4. Dimo
    Dimo avatar
    8407 posts

    Posted 30 Jun 2008 Link to this post

    Hello Adam,

    The filter row is part of the RadGrid header (it is in the <thead>), so it will disappear together with the header cells when ShowHeader="false".

    In order to hide the header cells only, please use the ItemCreated event handler and a little CSS:


        OnItemCreated="grdDom_OnItemCreated"  /> 


    protected void grdDom_OnItemCreated(object sender, GridItemEventArgs e) 
        if (e.Item is GridHeaderItem) 
            e.Item.Display = false


    .MyClass .GridHeaderDiv_Default 
    .MyClass .MasterTable_Default td, 
    .MyClass .MasterTable_Default th 

    The background-image:none style is added in order to remove a background image, which should be used only when the header cells are visible.

    The overflow:hidden style applied to the grid cells will fix the issue with the overlapping cell content, which is caused by the fact that the columns are too narrow and cannot enclose their content (when text wrapping is disabled).

    Let us know if you need further advice.

    Best wishes,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Rob Houck
    Rob Houck avatar
    21 posts
    Member since:
    Jul 2003

    Posted 30 Jun 2008 Link to this post

    That makes sense. I'll give it a try.

  6. Adam
    Adam avatar
    177 posts
    Member since:
    Oct 2012

    Posted 01 Aug 2008 Link to this post

    I think I've discovered a little bit more of the issue. The GridDataDiv is being set to 10px high, while the RadGrid itself is set to be 350px or so. That doesn't appear to be carrying over to the GridDateDiv unless I right click and refresh the page or cause a postback. This only appears to be happening when the RadGrid is inside of a RadWindow.

    We are currently using 2008 Q1 SP1 of the ASP.NET Ajax controls. If this is a fix in 2008 Q2, we will consider upgrading them soon.
  7. Dimo
    Dimo avatar
    8407 posts

    Posted 04 Aug 2008 Link to this post

    Hello Adam,

    It looks like you are setting a 100% height to RadGrid, but the control's parent element does not have height. Please refer to the following code libraries for more information and working examples. There is no RadWindow in them, but I recommend taking a page from the first code library project and placing it inside RadWindow. Everything should work as expected.

    Setting 100% height and resize on container resize for grid with scrolling and static headers

    How to Set 100% Height and Random Styles to a RadAjaxManager Update Panel

    Let us know if you still can't solve the problem. In this case, please send us the RadGrid declaration.

    Kind regards,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top