Click here to Skip to main content
15,906,816 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: ASP.NET v.2 code behind Pin
Brent Lamborn18-Aug-06 11:49
Brent Lamborn18-Aug-06 11:49 
GeneralRe: ASP.NET v.2 code behind Pin
Gary Hyslop at home18-Aug-06 13:27
Gary Hyslop at home18-Aug-06 13:27 
GeneralRe: ASP.NET v.2 code behind Pin
Brent Lamborn21-Aug-06 3:25
Brent Lamborn21-Aug-06 3:25 
QuestionGridview ClientSide column add and remove Pin
GaryT8018-Aug-06 10:11
GaryT8018-Aug-06 10:11 
AnswerRe: Gridview ClientSide column add and remove Pin
Mike Ellison18-Aug-06 10:47
Mike Ellison18-Aug-06 10:47 
GeneralRe: Gridview ClientSide column add and remove Pin
GaryT8021-Aug-06 12:10
GaryT8021-Aug-06 12:10 
QuestionGridview Searching and Filtering Pin
GaryT8018-Aug-06 10:09
GaryT8018-Aug-06 10:09 
AnswerRe: Gridview Searching and Filtering [modified] Pin
Brent Lamborn18-Aug-06 12:03
Brent Lamborn18-Aug-06 12:03 
It's the same as loading all the data into it. All you have to do is create a search form on the page with a button. In the button click event, pass the info the user enters in the search form into a function in your data layer which contains a select query/ stored procedure that returns only the results that match. Then bind the returned dataset to your gridview. Something like this:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
       If Not IsPostBack Then BindIt()
End Sub


Sub BindIt()
        Dim ds As New DataSet
        ds = data.GetEverything

        If ds.Tables.Count > 0 AndAlso ds.Tables(0).Rows.Count > 0 Then
            gdv.DataSource = ds
            gdv.DataBind()
        End If
End Sub


Protected Sub btnSearchSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearchSubmit.Click
        Dim ds As New DataSet
        ds = data.GetData(parmaterfromsearchform, another, another)

        If ds.Tables.Count > 0 AndAlso ds.Tables(0).Rows.Count > 0 Then
            gdv.DataSource = Nothing
            gdv.DataSource = ds
            gdv.DataBind()
        Else
            gdv.DataSource = Nothing
            gdv.DataBind()
        End If
    End Sub



-- modified at 18:05 Friday 18th August, 2006

"Half this game is ninety percent mental." - Yogi Berra

If you can read thank a teacher, if you can read in English, thank a Marine.

M y and h don't work so well due to m addiction to caffeine and m in abilit to to set a cup down uprigt.


GeneralRe: Gridview Searching and Filtering Pin
GaryT8021-Aug-06 4:16
GaryT8021-Aug-06 4:16 
GeneralRe: Gridview Searching and Filtering Pin
Brent Lamborn21-Aug-06 4:23
Brent Lamborn21-Aug-06 4:23 
GeneralRe: Gridview Searching and Filtering [modified] Pin
GaryT8021-Aug-06 5:56
GaryT8021-Aug-06 5:56 
GeneralRe: Gridview Searching and Filtering Pin
Brent Lamborn21-Aug-06 6:08
Brent Lamborn21-Aug-06 6:08 
QuestionSQL database in a .NET asp environment Pin
Rory Lewis18-Aug-06 8:29
Rory Lewis18-Aug-06 8:29 
AnswerRe: SQL database in a .NET asp environment Pin
seee sharp18-Aug-06 9:15
seee sharp18-Aug-06 9:15 
AnswerRe: SQL database in a .NET asp environment Pin
i.j.russell18-Aug-06 10:22
i.j.russell18-Aug-06 10:22 
QuestionASP.NET 2.0 Webservice call from ASP Pin
seee sharp18-Aug-06 8:04
seee sharp18-Aug-06 8:04 
QuestionHow to insert data into database from data set or datatable Pin
micydon18-Aug-06 5:49
micydon18-Aug-06 5:49 
AnswerRe: How to insert data into database from data set or datatable Pin
leckey18-Aug-06 6:19
leckey18-Aug-06 6:19 
AnswerRe: How to insert data into database from data set or datatable Pin
Not Active18-Aug-06 7:44
mentorNot Active18-Aug-06 7:44 
QuestionIs it possible to "Enable = false" on all a pages ASP.NET controls with a single command or loop? Pin
Red_Wizard_Shot_The_Food18-Aug-06 5:37
Red_Wizard_Shot_The_Food18-Aug-06 5:37 
AnswerRe: Is it possible to "Enable = false" on all a pages ASP.NET controls with a single command or loop? Pin
Colin Angus Mackay18-Aug-06 5:50
Colin Angus Mackay18-Aug-06 5:50 
AnswerRe: Is it possible to "Enable = false" on all a pages ASP.NET controls with a single command or loop? Pin
Mike Ellison18-Aug-06 7:19
Mike Ellison18-Aug-06 7:19 
QuestionGridView visibility issue Pin
Vipul Mehta18-Aug-06 5:11
Vipul Mehta18-Aug-06 5:11 
AnswerRe: GridView visibility issue Pin
Not Active18-Aug-06 5:49
mentorNot Active18-Aug-06 5:49 
QuestionGridView event fired twice Pin
Talal Sultan18-Aug-06 4:42
Talal Sultan18-Aug-06 4:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.