Telerik radgrid过滤器不再工作 - SP 2010

时间:2013-04-22 18:40:56

标签: c# asp.net sharepoint telerik radgrid

我现在正在管理一个拥有一系列各种报告的sharepoint站点,这些报告基本上都是充满数据的radgrids。用户抱怨过滤不再适用于大多数报告。

他们以前都工作得很好,由于某种原因,现在只有部分页面会被过滤,其他页面则什么都不做。我对telerik相对较新,无法弄清楚为什么会出现排序问题。

c#代码位于SP 2010之上

这是radgrid的代码

                                                                                                                                                                         

                <%-- raok 10/2012 - add employee ID to report --%>
                <telerik:GridBoundColumn SortExpression="Employee_ID" HeaderText="Employee ID" HeaderButtonType="TextButton"
                    DataField="Employee_ID" Visible="true" AllowFiltering = "false">
                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn SortExpression="Form_Has_Conflicts" HeaderText="Form Has Conflicts"
                    HeaderButtonType="TextButton" DataField="Form_Has_Conflicts" Visible="true" AllowFiltering = "false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn SortExpression="Employee_Supervisor" HeaderText="Employee Supervisor"
                    HeaderButtonType="TextButton" DataField="Employee_Supervisor" Visible="true" AllowFiltering = "false">
                </telerik:GridBoundColumn>                            
                <telerik:GridBoundColumn SortExpression="Last_Name" HeaderText="Last Name" HeaderButtonType="TextButton"
                    DataField="Last_Name" Visible="true" AllowFiltering = "false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn SortExpression="DateModified" HeaderText="Date Modified"
                    HeaderButtonType="TextButton" DataField="DateModified" Visible="true" AllowFiltering = "false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn SortExpression="Employee_VP" HeaderText="Employee VP" HeaderButtonType="TextButton"
                    DataField="Employee_VP" Visible="true" AllowFiltering = "false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn SortExpression="Employee_Supervisor" HeaderText="Employee Supervisor"
                    HeaderButtonType="TextButton" DataField="Employee_Supervisor" Visible="true" AllowFiltering = "false">
                </telerik:GridBoundColumn>
            </Columns>
        </telerik:GridTableView>
    </DetailTables>
    <Columns>
        <telerik:GridBoundColumn SortExpression="Title" HeaderText="Title" HeaderButtonType="TextButton"
            DataField="Title" Visible="True" AllowFiltering="true" FilterControlWidth = "260px" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains">
            <HeaderStyle Width="290px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn SortExpression="Cycle_Year" HeaderText="Cycle Year" HeaderButtonType="TextButton"
                    DataField="Cycle_Year" Visible="false" AllowFiltering="false">
                </telerik:GridBoundColumn>
        <telerik:GridBoundColumn SortExpression="Form_ID" HeaderText="Form ID" HeaderButtonType="TextButton"
            DataField="ID" Visible="True" AllowFiltering="false">
            <HeaderStyle Width="60px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn SortExpression="Form_Status" HeaderText="Form Status" HeaderButtonType="TextButton"
            DataField="Form_Status" Visible="false" AllowFiltering="false">
            <HeaderStyle Width="100px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn SortExpression="Last_Modified_by" HeaderText="Last Modified by"
            HeaderButtonType="TextButton" DataField="Last_Modified_by" Visible="true" AllowFiltering="false">
            <HeaderStyle Width="150px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn SortExpression="Created_By" HeaderText="Created By" HeaderButtonType="TextButton"
            DataField="Created_By" Visible="true" AllowFiltering="false">
            <HeaderStyle Width="150px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn SortExpression="EmployeeFullName" HeaderText="Form Owner Last Name" HeaderButtonType="TextButton"
            DataField="EmployeeFullName" Visible="false" UniqueName="EmployeeFullNameColumn" AllowFiltering="false">
        </telerik:GridBoundColumn>
    </Columns>
</MasterTableView>
<ClientSettings>
    <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True">
    </Scrolling>
    <Selecting AllowRowSelect="true" />
</ClientSettings>

1 个答案:

答案 0 :(得分:1)

AllowFiltering="false"更改为您需要的AllowFiltering="true"

例如在你的代码中&#34;标题&#34;过滤器工作但在&#34; Cycle_Year&#34;它没有。

另请注意,要使用内置过滤器,您需要设置AllowFilteringByColumn="True"

<telerik:RadGrid ID="SomeID" AllowFilteringByColumn="True"

您还可以制作自定义过滤器以及更多信息,请参阅this以获取更多信息,并查看有关过滤器的内容树。

而且我注意到你已设置CurrentFilterFunction="SomeFilter"这为该过滤器设置了启动过滤器选项,如果它不能使用该选项过滤某些内容则不起作用,例如对数字使用字母过滤器