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?

    Thanks,
    Adam
  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.

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


    Thanks
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. 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" 
                            PageSize="100">  
                            <pagerstyle mode="Slider" /> 
                            <mastertableview datakeynames="DDID,Editable" showheader="False" borderwidth="0px">  
    <RowIndicatorColumn Visible="False">  
    <HeaderStyle Width="20px"></HeaderStyle> 
    </RowIndicatorColumn> 
     
    <ExpandCollapseColumn Visible="False" Resizable="False">  
    <HeaderStyle Width="20px"></HeaderStyle> 
    </ExpandCollapseColumn> 
    <Columns> 
    <telerik:GridClientSelectColumn HeaderText="Include" UniqueName="Include">  
    <HeaderStyle Width="12%"></HeaderStyle> 
    </telerik:GridClientSelectColumn> 
    <telerik:GridBoundColumn DataField="Domain" HeaderText="Domain" UniqueName="column1">  
    <HeaderStyle Width="88%"></HeaderStyle> 
    </telerik:GridBoundColumn> 
    </Columns> 
     
    <EditFormSettings> 
    <PopUpSettings ScrollBars="None"></PopUpSettings> 
    </EditFormSettings> 
     
    <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> 
    </mastertableview> 
                            <clientsettings> 
    <Selecting AllowRowSelect="True"></Selecting> 
     
    <ClientEvents OnRowSelecting="RowSelecting"></ClientEvents> 
     
    <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling> 
    </clientsettings> 
                        </telerik:RadGrid> 
     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.
  5. Dimo
    Admin
    Dimo avatar
    8333 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:

    ASPX

    <telerik:RadGrid 
        ID="grdDom" 
        Skin="Default" 
        CssClass="MyClass" 
        OnItemCreated="grdDom_OnItemCreated"  /> 


    C#

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


    CSS

     
    .MyClass .GridHeaderDiv_Default 
        background-imagenone
     
    .MyClass .MasterTable_Default td, 
    .MyClass .MasterTable_Default th 
        overflowhidden


    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,
    Dimo
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. 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.

    Thanks,
    Adam
  7. 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.
  8. Dimo
    Admin
    Dimo avatar
    8333 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,
    Dimo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017