This is a migrated thread and some comments may be shown as answers.

Filter gone when header is suppressed

6 Answers 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 24 Jun 2008, 05:58 PM
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

6 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 25 Jun 2008, 06:26 AM
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.
0
Adam
Top achievements
Rank 1
answered on 27 Jun 2008, 04:04 PM
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.
0
Dimo
Telerik team
answered on 30 Jun 2008, 05:59 AM
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
0
Pau
Top achievements
Rank 1
answered on 30 Jun 2008, 05:07 PM
That makes sense. I'll give it a try.

Thanks,
Adam
0
Adam
Top achievements
Rank 1
answered on 01 Aug 2008, 06:05 PM
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.
0
Dimo
Telerik team
answered on 04 Aug 2008, 06:29 AM
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.
Tags
Grid
Asked by
Adam
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Adam
Top achievements
Rank 1
Dimo
Telerik team
Pau
Top achievements
Rank 1
Share this question
or