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

RadGrid footer is not displaying on show and hide filter options

1 Answer 226 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Raj
Top achievements
Rank 1
Raj asked on 16 Sep 2010, 03:24 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? Here is my code

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();
}

<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>
                                                        <telerik:GridBoundColumn DataField="ProjectId" UniqueName="ProjectId" Visible="false">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="LOB" DataField="LOB" UniqueName="LOB">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Division Name" DataField="Division" UniqueName="Division">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Region Name" DataField="MarketName" UniqueName="MarketName">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Project Name" DataField="ProjectName" UniqueName="ProjectName">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Project Manager Name" DataField="ProjectMgrName"
                                                            UniqueName="ProjectMgrName">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Number Of Sites Received" DataField="NumSitesReceived"
                                                            UniqueName="NumSitesReceived">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Accept Service Order Date" DataField="AcceptServiceOrderTaskCompleteDate"
                                                            UniqueName="AcceptServiceOrderTaskCompleteDate" DataFormatString="{0:MM/dd/yyyy}">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="PTD" DataField="PTD" UniqueName="PTD" DataFormatString="{0:MM/dd/yyyy}">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Health Reason" DataField="HealthReason" UniqueName="HealthReason">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Project Health" DataField="ProjectHealth" UniqueName="ProjectHealth">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Customer Signed Date" DataField="CustomerSignedDate"
                                                            UniqueName="CustomerSignedDate" DataFormatString="{0:MM/dd/yyyy}">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="OA Complete Date" DataField="OACompleteDate"
                                                            UniqueName="OACompleteDate" DataFormatString="{0:MM/dd/yyyy}">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Customer Requested Due Date" DataField="CustomerRequestedDueDate"
                                                            UniqueName="CustomerRequestedDueDate" DataFormatString="{0:MM/dd/yyyy}">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Last Note Added" DataField="LastNoteAdded" UniqueName="LastNoteAdded">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridTemplateColumn UniqueName="EditRows" HeaderStyle-Width="3%" ItemStyle-Width="3%"
                                                            AllowFiltering="false">
                                                            <ItemTemplate>
                                                                <asp:ImageButton runat="server" ID="EditPMTsk" CommandName="EditRow" ImageUrl="Images/edit-icon.png"
                                                                    ImageAlign="Middle" ToolTip="Edit Task" />
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                    </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>

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)
    {
    }
 
}


Thanks.

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 17 Sep 2010, 08:42 AM
Hello Raj,

The problem is caused by the overflow style applied to the RadGrid parent <div>. When you show the filter row, the RadGrid becomes higher, so it needs more space. You should either remove the overflow-y:hidden style or change it to "auto". Alternatively, set a smaller initial height to RadGrid.

overflow-y: hidden

Regards,
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
Raj
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or