2

I need to use a grid that allows for filtering in the column headers. I know there are some third-party components out there that cost money. I am looking for something that is free / open-source that can be used on a project. Is anyone aware of a GridView that can do this?

2 Answers 2

2

One way is to put drop down lists in the headers and on the selectedchanged event, rebind your grid based on that.

Sign up to request clarification or add additional context in comments.

Comments

1

I too needed some filtering and sorting across columns, so I looked around and put this together. See here and here. It's dynamic and the markup looks like this, the codebehind is 1000+ rows -not sure if I can post it here.

 <%@ 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>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.