Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
i want to filter grid view from dropdownlist and text box , like i select the column from dropdown and name,id,phone number anything from text box how can i do this process
Posted 1-Jul-12 21:29pm
Arjun YK at 2-Jul-12 3:35am
can u please be clear with the question.
ooffooooo at 2-Jul-12 3:46am
i have a gridview i want to filter that grid view , drop down list should will select the column and text box will filter the column. like in ID NAME Phone Designation fields in gridview . i will select Designation in dropdown and type programmer in text box .so it should filter programmers from the gridview
Sandeep Mewara at 2-Jul-12 3:37am
Not clear. Dropdown & textbox are inside grid or outside?
ooffooooo at 2-Jul-12 3:43am
dropdownlist and text box should be outside the gridview
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

i hope it will help you
we can use data views to filter the data in grid view
Filter the data in Grid view[^]
sorting data in grid view header selection[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

1.If YOu are binding grid in code behind refer this
2.If you are using SqlDatsource
<asp:textbox id="contractID" runat="server" >duration</asp:textbox>
<asp:textbox id="duration" runat="server" >duration</asp:textbox>
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1">
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT DISTINCT * FROM [Contract]" FilterExpression="contractID LIKE '{0}%' AND duration LIKE '{1}%'">
<asp:ControlParameter ControlID="contractID" Name="contractID"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="duration" Name="duration" PropertyName="Text"
Type="String" />

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
0 Shai Vashdi 963
1 Tadit Dash 270
2 Sergey Alexandrovich Kryukov 250
3 OriginalGriff 233
4 Peter Leow 180
0 Sergey Alexandrovich Kryukov 9,435
1 OriginalGriff 5,498
2 Peter Leow 4,230
3 Maciej Los 3,540
4 Abhinav S 3,353

Advertise | Privacy | Mobile
Web04 | 2.8.140415.2 | Last Updated 2 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid