2010-08-01 108 views
2

我需要使用允许在列标题中进行筛选的网格。我知道有一些第三方组件需要花钱。我正在寻找可以在项目中使用的免费/开放源代码的东西。有没有人知道可以做到这一点的GridView?ASP.NET GridView在列标题中进行筛选

回答

1

我太需要一些过滤和跨列排序,所以我环顾四周,把这个在一起。 请参阅here和这里。 它是动态的,标记看起来像这样,代码隐藏是1000多行 - 不知道我是否可以在这里发布它。

<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" 
    CodeFile="Default.aspx.vb" Inherits="_Default" EnableViewState="True"%> 
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> 
     <link href="AdminCSS.css" rel="stylesheet" type="text/css" /> 
     <asp:DropDownList ID="ddl1" runat="server" AutoPostBack="True"> 
     </asp:DropDownList> 
     <asp:DropDownList ID="ddl2" runat="server" AutoPostBack="True"> 
      <asp:ListItem Value="BASE TABLE">Only tables</asp:ListItem> 
      <asp:ListItem Value="VIEW">Only Views</asp:ListItem> 
      <asp:ListItem Selected="True" Value="%">Tables and Views</asp:ListItem> 
     </asp:DropDownList> 
     <asp:DropDownList ID="ddl3" runat="server" AutoPostBack="True"> 
      <asp:ListItem>SELECT TOP 1</asp:ListItem> 
      <asp:ListItem Selected="True">SELECT TOP 50</asp:ListItem> 
      <asp:ListItem>SELECT TOP 200</asp:ListItem> 
      <asp:ListItem>SELECT TOP 1000</asp:ListItem> 
      <asp:ListItem>SELECT TOP 5000</asp:ListItem> 
      <asp:ListItem>SELECT</asp:ListItem> 
     </asp:DropDownList> 
     <asp:CheckBox ID="chkSideways" AutoPostBack="true" Text="Show Tabs Sideways" runat="server"> 
     </asp:CheckBox> 
     <asp:Label ID="lblTbleCount" runat="server" Text="" Style="margin-left: 30px"></asp:Label> 
    </asp:Content>