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

Filter button has column header menu after postback

1 Answer 31 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 1
Joel asked on 08 Sep 2014, 10:52 PM
I'm having some trouble with filter menus. When I first load the page, I don't have menus when I click the filter buttons.

I then filter using the CurrentFilterFunction="Contains" setting and pressing <tab>, a postback occurs, and now my filter buttons have the column header menus (Sort Ascending..., Group By, Best fit, etc.)

Any ideas why or what I can do to get and keep the proper filter menus?

C#
protected override void OnPreRender(System.EventArgs e)
{
    // ... Control setup unrelated to RadGrid1
  
    // Test filtering
    bool Filter = true;
    if (Filter)
    {
        RadGrid1.AllowFilteringByColumn = Filter;
        RadGrid1.MasterTableView.AllowFilteringByColumn = Filter;
    }
}

// I've also got handlers for these, but they don't setup filtering:

            RadGrid1.PreRender += RadGrid1_PreRender;
            RadGrid1.ItemCreated += RadGrid1_ItemCreated;
            RadGrid1.ItemDataBound += RadGrid1_ItemDataBound;
            RadGrid1.NeedDataSource += RadGrid1_NeedDataSource;
            RadGrid1.GroupsChanging += RadGrid1_GroupsChanging;



ASCX
<telerik:RadGrid EnableViewState="true" ID="RadGrid1" runat="server" AllowSorting="True" AllowPaging="True" GridLines="None" PageSize="25" AutoGenerateColumns = "false"
                    OnExcelMLWorkBookCreated="RadGrid1_ExcelMLWorkBookCreated" OnItemCreated="RadGrid1_ItemCreated" OnHTMLExporting="RadGrid1_HtmlExporting"
                    AllowMultiRowSelection="True" ShowFooter="true" ShowGroupPanel="True" EnableHeaderContextMenu="true"  Skin="Xledger" EnableEmbeddedSkins="false" style="z-index: 0;">
 
                    <PagerStyle AlwaysVisible="true" />
 
                     <ExportSettings IgnorePaging="true" OpenInNewWindow="true">
                        <Pdf PageHeight="210mm" PageWidth="297mm" DefaultFontFamily="Arial Unicode MS" PageTopMargin="45mm" BorderStyle="Medium" BorderColor="#666666"></Pdf>
                    </ExportSettings>
 
                    <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true" ColumnsReorderMethod="Reorder" AllowDragToGroup="true">
 
                        <Resizing AllowRowResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True" AllowColumnResize="True" AllowResizeToFit="true"></Resizing>
                        <Selecting AllowRowSelect="true" />
                        <Scrolling AllowScroll="false"/><%--<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="2"></Scrolling> --%>
 
                    </ClientSettings>
 
                    <GroupingSettings ShowUnGroupButton="true" RetainGroupFootersVisibility="true"></GroupingSettings>
  
                    <MasterTableView ShowGroupFooter="true" TableLayout="Auto"  Width="100%" AllowMultiColumnSorting="true" AllowGroupCollapse="true" GroupLoadMode="Client" EnableGroupsExpandAll="true">
 
                        <%-- AUTOGROUP BY ACCOUNT GROUP
                         <GroupByExpressions>
                          <telerik:GridGroupByExpression>
                            <SelectFields>
                              <telerik:GridGroupByField FieldName="t_rv_account_group" />
                            </SelectFields>
                            <GroupByFields>
                              <telerik:GridGroupByField FieldName="t_rv_account_group" />
                            </GroupByFields>
                          </telerik:GridGroupByExpression>
                        </GroupByExpressions>
                        --%>
 
                        <Columns>
                            <telerik:GridBoundColumn UniqueName="trvAccountGroup" DataField="t_rv_account_group" DataType="System.String" HeaderText="trvAccountGroup"  AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="trvSysAccount" DataField="t_rv_sys_account" DataType="System.String" HeaderText="trvSysAccount"></telerik:GridBoundColumn>
 
<%-- ... more columns ... --%>
 
 
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 11 Sep 2014, 12:49 PM
Hi Joel,

I prepared a small sample based on the provided code and on my side seems to work correctly. Could you please give it a try and let me know how it differs from your real setup?

Regards,
Kostadin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Joel
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or