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 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sai
Top achievements
Rank 1
Sai asked on 16 Sep 2010, 06:42 PM
Hi,

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">
                <CommandItemTemplate>
                    <table style="width: 100%">
                        <tr>
                            <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>
                            <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>
                            <td align="right" style="width: 5%">
                                    
                                <asp:ImageButton ID="ExportToExcelButton" runat="server" ImageUrl="~/images/ExportToExcel.gif"
                                    ToolTip="Export to Excel" OnClick="ExportExcel_Click" />
                            </td>
                        </tr>
                    </table>
                </CommandItemTemplate>
                <Columns>
                    ........ some columns here.......
                </Columns>
                <ItemStyle ForeColor="#3C5F22" Font-Size="8pt" BackColor="White" BorderWidth="0px"
                    BorderColor="White" />
                <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />
            </MasterTableView>
            <ClientSettings AllowColumnsReorder="true">
                <ClientEvents OnGridCreated="GridCreated" />
                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                <Resizing AllowColumnResize="true" />
            </ClientSettings>
        </telerik:RadGrid>
    </div>


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) {
    sender.get_masterTableView().hideFilterItem();
}

protected void gvPjtMnt_ItemCreated(object sender, GridItemEventArgs e)
    {
        try
        {
            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
0
Dimo
Telerik team
answered on 17 Sep 2010, 08:44 AM
Sai,

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:

http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-footer-is-not-displaying-on-show-and-hide-filter-options.aspx

Greetings,
Dimo
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
Tags
Grid
Asked by
Sai
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or