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

RadGrid PageStyle is not displaying on show and hide filter click event

1 Answer 87 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Sai asked on 16 Sep 2010, 06:42 PM

I have radgrid with show and hide filter options. Initially filter is disabled. When i click show filter button it is displaying the filter but pageritem in the bottom is not displaying if i click hide button the pageritem is displaying. (Please see the Iamges) I set " PagerStyle-AlwaysVisible="true" ". But still no luck. Can anyone help me how to fix this? ( I am reposting this thread because I am unable to upload pics to my previous post)

Here is my code

<div style="width: 98%; overflow: auto; overflow-y: hidden">
        <telerik:RadGrid ID="gvPjtMnt" runat="server" Height="600px" AutoGenerateColumns="false"
            BorderWidth="2px" BorderStyle="Solid" BackColor="White" AllowPaging="True" PagerStyle-AlwaysVisible="true"
            PageSize="20" AllowSorting="True" AllowFilteringByColumn="true" OnNeedDataSource="gvPjtMnt_OnNeedDataSource"
            OnItemCommand="gvPjtMnt_ItemCommand" OnItemCreated="gvPjtMnt_ItemCreated" EnableViewState="true">
            <HeaderStyle Height="20px" BackColor="#004000" Font-Size="8pt" Font-Bold="True" ForeColor="White"
                HorizontalAlign="Center" BorderColor="White" BorderWidth="1px" />
            <AlternatingItemStyle Font-Size="8pt" BackColor="#F5F5E9" HorizontalAlign="Center"
                BorderWidth="1px" BorderColor="White" />
            <ItemStyle HorizontalAlign="Center" />
            <MasterTableView GridLines="None" CommandItemDisplay="Top" DataKeyNames="ProjectId"
                HorizontalAlign="Center" AllowFilteringByColumn="true">
                    <table style="width: 100%">
                            <td align="right" style="width: 80%">
                                <asp:LinkButton ID="lnkshwFilter" Text="ShowFilter" Font-Underline="true" ForeColor="MidnightBlue"
                                    runat="server" OnClientClick="return showFilterItem()" />
                                <asp:LinkButton ID="lnkhdFilter" Text="HideFilter" Font-Underline="true" ForeColor="MidnightBlue"
                                    runat="server" OnClientClick="return hideFilterItem()" />
                            <td align="right" style="height: 10px;">
                                Total Records found: <asp:Label ID="lblTotRecCount" runat="server" Font-Bold="True"
                                    Font-Size="10pt" ForeColor="Black" Text="0"></asp:Label>
                            <td align="right" style="width: 5%">
                                <asp:ImageButton ID="ExportToExcelButton" runat="server" ImageUrl="~/images/ExportToExcel.gif"
                                    ToolTip="Export to Excel" OnClick="ExportExcel_Click" />
                    ........ some columns here.......
                <ItemStyle ForeColor="#3C5F22" Font-Size="8pt" BackColor="White" BorderWidth="0px"
                    BorderColor="White" />
                <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />
            <ClientSettings AllowColumnsReorder="true">
                <ClientEvents OnGridCreated="GridCreated" />
                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                <Resizing AllowColumnResize="true" />

function showFilterItem() {
    $find('<%=gvPjtMnt.ClientID %>').get_masterTableView().showFilterItem();
    document.getElementById('ctl00_PagePlaceholder_gvPjtMnt_ctl00_ctl02_ctl00_lnkhdFilter').style.display = 'block';
    document.getElementById('ctl00_PagePlaceholder_gvPjtMnt_ctl00_ctl02_ctl00_lnkshwFilter').style.display = 'none';
    return false;
function hideFilterItem() {
    document.getElementById('ctl00_PagePlaceholder_gvPjtMnt_ctl00_ctl02_ctl00_lnkhdFilter').style.display = 'none';
    document.getElementById('ctl00_PagePlaceholder_gvPjtMnt_ctl00_ctl02_ctl00_lnkshwFilter').style.display = 'block';
    $find('<%=gvPjtMnt.ClientID %>').get_masterTableView().hideFilterItem();
    return false;
function GridCreated(sender, args) {

protected void gvPjtMnt_ItemCreated(object sender, GridItemEventArgs e)
            if (e.Item is GridCommandItem)
               LinkButton st = (LinkButton)e.Item.FindControl("lnkhdFilter");
               st.Style["display"] = "none";
        catch (Exception ex)

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 17 Sep 2010, 08:44 AM

Why do you post related questions in different forum threads and from different accounts? It will be a lot more convenient for you and us if you do this in a single forum thread from the same account.

Please refer to:

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
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question