Display Search Results in GridView

How would I go about displaying search results in a gridview.  My confusion is centered around the fact that when the page loads there is no data to display until a search is performed.  I have two thoughts on this. Put a literal in as a place holder and then in the code behind for the search button create the datasource and write out all the asp code for the datagrid to the literal.  My other thought is to have the gridview in the default.aspx but marked as not visible.  Then when I perform the search set the datasourceid property and mark it visible. I am not sure if this is possible since I am not seeing any sort of a bind method.

I am sure this is a very common task so there must be a good way to do this. 

thanks in advance.  

0
digitaladdictions
12/14/2006 10:25:53 PM
asp.net.getting-started 91979 articles. 4 followers. Follow

1 Replies
634 Views

Similar Articles

[PageSpeed] 0
Get it on Google Play
Get it on Apple App Store

A gridview allows you to set a template for when no data is available - so you can display a message.

You can simply set the gridview visible=false - so it wont even get rendered to the client


If it was easy, everybody would be doing it.
0
sbyard
12/15/2006 12:46:44 AM
Reply:

Similar Artilces:

search engine and displaying search results with gridview
 Hi all,I am a newbie with ASP.NET.I have a gridview that display data from the database.I want to implement a search engine. When the user enters a keyword in the textbox then click on the search button the result will be displayedto the gridview. How do I do this? How do I implement a search engine so that when the user enters a keyword on the textbox and hit the search button the data will then be displayed in the gridview? Here's is my code. The texbox and search button are highlighted in bold case: <%@ Page Language="C#" AutoEventWireup="true"&n...

How to Display Search Result Into a Gridview
Hi Folks! I'm stuck with my VB 2005 web project in writing the code for a button_click event that will display the search result in a gridview from the database. I have a textbox where the user types in the keyword. I have done up a query in the objectDataSource which is: SELECT * From tblBookingsWHERE Event LIKE '%' + @Event + '%' Can anyone please point me to the right direction? Much appreciate your advices. Cheers! Resty  see this example  <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="tru...

Displaying randomised search results in GridView
I have an MS-SQL Stored Procedure that returns search results in a random order each time it is executed. These results are displayed in a GridView through an SqlDataSource control but I've discovered a problem with results that span across more than one page on the GridView. If a link in the pager is selected, sometimes a result appears that was also on another page. Of course, what's happening is that each time a link in the pager is selected, it executes the stored procedure and gets another set of random search results which leads to some results appearing on different pages. So what I...

Displaying "Sorry there were no results for your search" for a search that yields no results
Hello, I've got an SQL datasource and a GridView control on a page called textsearch.aspx (in a VS web application). The text that the user is searching for is passed in as a querystring - e.g. if the user searches for "clematis" he's navigated to textsearch.aspx?Search=clematis. This all works fine as long as there is something that's called "clematis" (or whatevers being search for) in my database. However, if there are no matches in my database nothing is displayed (except for what's on my master page). I need to be able to display a message which says something to the effect of "Sorry...

Display different search results in one gridview
I have a grid view that called by a SP(usp_FindrecordbychecknumID -- The sp will return the matching result based on the passing value ( either Check # or Id)  ) There are two text boxes and submit buttons ( search by check # and search by ID ) on the ASP.net page. If a user type a check #   in the “ Search by Check #” text box and click submit button, the matching records in a gridview will be displayed ( it works same way for “Search by ID” text box ). The SP is working fine, but on the ASP page when I click the submit button( either...

problem displaying advance search result into gridview
hi all i tried a few example from the previous post.. why it did not work for me.. can anybody give me the hint on how to solve my problem    Which post are you referring to? i'm refering the post on "display the search result into gridview" can you give us the link ?   http://forums.asp.net/t/1322600.aspx when i click on "search button"..nothing appear Hi syud_zack , I suggest you to have a look at this link which can teach you how to do this step by step : http://www.exforsys.com/tutorials/asp.net-2.0/asp.net-2.0-gridvi...

How to search database then return results to a Gridview or other display ?
 I can connect to my datasource and by adding a gridview or other I can fill it when running the page.  Now what I have done is added a text box and button to the page. I want someone to be able to enter say a vendor # and click the button and fill the gridview or other.   I need to know how to assosicate the text box to the field of the table I am searching as well as how to pull the results back and display them?    I remember there was and old video in here that showed how it was done but its been long replaced by newer tutorials.Mike Dibble Hi, take a look ...

Display result from search with gridview only when the button is pressed
I trying to make a search function for my page.How can I start the page without showing the gridview (the data in the database). The gridview should write out the result from the search, when the button is pushed. Set the visible property of the GridView to False in the GridView declaration. Then in the Click handler, you would set the GridView.Visible back to True if you have search results to display.Mike Banavige~~~~~~~~~~~~Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/ Of course..thanks!!! I get errors on the syntax, whats w...

How to Search an SQL Server Database and Display Results in a Gridview
I am trying to create a web application that has a search function. I would like to search the database with the text that the user inputs into the TextBox and then display the results in a GridView. I would also like to split up the value if the user where to type in multiple strings.  For Example:  "chicken sausage beef" and then search the database for those 3 separate strings.. Can anyone help me accomplish this?  Hi, I give split function.CREATE PROCEDURE dbo.sp_Txt_Split( @sInputList varchar(8000) -- List of delimited items , @Delimiter c...

Sharepoint search-'How to provide 'Display more results' link in sharepoint search result core webpart.
 Hi,Currently i am working with sharepoint search result presentation.I am dealing with search core result webpart.My requirement is , i need to show top five results and then need to show 'X more results' link.when user clicks on this remaining results should displayed. Can anybody help me on this? Regards,Hina.  Hi Hina,             We have a paging option in Dataview Properties.i hope you know this already..Goto webpart Dataview Properties, in paging pane. Set " Display Items in the set of size " to '5 '..then you...

Displaying Search String Results in GridView using String Array
I created a .aspx page with a search function to look for records in the database based on the keyword the user inputs into the textbox and then display the results in a gridview when the user clicks the submit button.  As of right now I have setup an SQLDataSource on the page that runs the following query:SELECT * FROM [recipe] WHERE ([keyword] LIKE '%' + @keyword + '%') I also setup an event handler for the Button1_Click event to set the SQLDataSource I created as the DataSource for the GridView and then did a Databind();protected void Button1_Click(object send...

When concurrent searches performed results are getting cross displayed for some users
Hi All,We have developed a search application for our client and we are facing issues with concurrent Search request. When 10 users perform the search concurrently, 2 or 3 users gets the result for parameter submited by another user. But if he refresh the page, he will get his expected result. This happens in random and does not follow any pattern to reproduce.This reproducable only at client network environment, we have tried many times in our network environment by accessing the Web Same Server. Only different I could figure out is they are using a firewall and Sophos Antivirus in their ne...

Use Search button on one page and display results in gridview on second page
Hello! I am wanting to do a search button on website. I have a "Search button" and a textbox where users will enter their information. After they hit the search button, I would like for them to nagviate to the "SearchResults.aspx" page where the results will be displayed in a gridview. I will be ONLY searching on one table called "Requests" where one of the columns is named "Summary"....i just need to search within the summary column basically. How would I go about doing this? Your help is very much appreciated! Thanks :-)"People will mainly...

Any search results in a critical error
Every attempt to perform a search results in a critical error and the exception shown below. Any ideas about what is not configured correctly? This is just a base installation of DNN. AssemblyVersion: 03.01.01Method: DotNetNuke.UI.Skins.Controls.Search.cmdSearch_ClickFileName: FileLineNumber: 0FileColumnNumber: 0PortalID: 0PortalName: James Buchanan Elementary School PTOUserID: 1UserName: hostActiveTabID: 48ActiveTabName: Log ViewerAbsoluteURL: /Default.aspxAbsoluteURLReferrer: http://www.ooo.ooo/Admin/LogViewer/tabid/48/Default.aspxExceptionGUID: 3216aebc-6720-4e92-8054-94ae7b54a54cDef...

Web resources about - Display Search Results in GridView - asp.net.getting-started

GridView SelectedItem Binding Gotcha in WinRT
Last night when I was doing some WinRT hacking I was trying to setup databinding to the selected item in the GridView control and I ran into ...

CNW Group
Home Services Beyond the Wire About CNW Financials Webcasts Events My CNW All News Releases Advanced Search Gridview Latest News Releases All ...

CNW Group
... Services Beyond the Wire About CNW my CNW CNW Access CNW Directories Financials Webcasts Events my CNW All News Releases Advanced Search Gridview ...

CNW Group
Home Services Beyond the Wire About CNW Financials Webcasts Events My CNW All News Releases Add a Filter Gridview Latest News Releases All Today ...

New CmdLets of Powershell 2.0
New CmdLets of Powershell 2.0

Price Drop: Softbox
... objects- create product reflection- changing the background with something more interestingUse it as:- softbox- honeycomb softbox- gridview ...

Profile.aspx: ASP Alliance
.NET,ASP,ASP.NET,SQL,XML,HTML,ADO,ADO.NET,JavaScript,JScript,CSharp,VBScript and VB tutorials from AspAlliance.

Quick Answers - CodeProject
Questions - Free source code and tutorials for Software developers and Architects.; Updated: 25 Oct 2012

DotNetKicks.com - Upcoming stories
DotNetKicks.com is a community based news site edited by our members. It specialises in .NET development techniques, technologies and tools including ...

View Features - ExtendASP
Call 847-681-9827 or Request a Demo View Features Testimonials Pricing About Us Coming Soon ExtendASP exposes every feature, more than any other ...

Resources last updated: 1/16/2016 7:53:06 AM