473,757 Members | 9,463 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Prevent gridview retrieve on page load

Hi,

I have a form with textboxes, a search button and a gridview. The textboxes
are filled with default values so that the gridview should return all rows
but not before the user has had the chance to change some of the textboxes
and has clicked the search button.
How can I avoid the gridview displaying all rows before the search button
was clicked?
Any Ideas? Thanks
Diane
Jul 31 '06 #1
5 4125
Diane,

A gridview displays its content. If there is no content, there is nothing to
display. In most scenarios a gridview gets populated as a result of
databinding. Probably, you are calling DataBind method for the gridview or
for the page. In the latter case, replace a DataBind call for the page with
DataBind calls to specific components that need databinding. And call
DataBind for the grid in the event handler for the search button.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"Diane Truyens" <diane.truyens( removethis)@akt ivconsulting.be wrote in
message news:98******** *************** ***********@mic rosoft.com...
Hi,

I have a form with textboxes, a search button and a gridview. The
textboxes
are filled with default values so that the gridview should return all rows
but not before the user has had the chance to change some of the textboxes
and has clicked the search button.
How can I avoid the gridview displaying all rows before the search button
was clicked?
Any Ideas? Thanks
Diane

Jul 31 '06 #2
Thanks Eliyahu for your answer. I'm new in ASP(.net) probably that's why it
is not yet fully clear to me how to control databinding. I use an
objectdatasourc e with a tableadapter to populate my gridview. I presume this
is an 'automated' databind? How can I prevent it and trigger the databinding
when the search button is clicked?
--
Thanks
Diane
"Eliyahu Goldin" wrote:
Diane,

A gridview displays its content. If there is no content, there is nothing to
display. In most scenarios a gridview gets populated as a result of
databinding. Probably, you are calling DataBind method for the gridview or
for the page. In the latter case, replace a DataBind call for the page with
DataBind calls to specific components that need databinding. And call
DataBind for the grid in the event handler for the search button.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"Diane Truyens" <diane.truyens( removethis)@akt ivconsulting.be wrote in
message news:98******** *************** ***********@mic rosoft.com...
Hi,

I have a form with textboxes, a search button and a gridview. The
textboxes
are filled with default values so that the gridview should return all rows
but not before the user has had the chance to change some of the textboxes
and has clicked the search button.
How can I avoid the gridview displaying all rows before the search button
was clicked?
Any Ideas? Thanks
Diane


Jul 31 '06 #3
I think, if you use DataSourceID property, the databinding will take place
automatically as your set the property. Instead use DataSource property.
Than you will have to call DataBind manually.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"Diane Truyens" <diane.truyens( removethis)@akt ivconsulting.be wrote in
message news:DB******** *************** ***********@mic rosoft.com...
Thanks Eliyahu for your answer. I'm new in ASP(.net) probably that's why
it
is not yet fully clear to me how to control databinding. I use an
objectdatasourc e with a tableadapter to populate my gridview. I presume
this
is an 'automated' databind? How can I prevent it and trigger the
databinding
when the search button is clicked?
--
Thanks
Diane
"Eliyahu Goldin" wrote:
>Diane,

A gridview displays its content. If there is no content, there is nothing
to
display. In most scenarios a gridview gets populated as a result of
databinding. Probably, you are calling DataBind method for the gridview
or
for the page. In the latter case, replace a DataBind call for the page
with
DataBind calls to specific components that need databinding. And call
DataBind for the grid in the event handler for the search button.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"Diane Truyens" <diane.truyens( removethis)@akt ivconsulting.be wrote in
message news:98******** *************** ***********@mic rosoft.com...
Hi,

I have a form with textboxes, a search button and a gridview. The
textboxes
are filled with default values so that the gridview should return all
rows
but not before the user has had the chance to change some of the
textboxes
and has clicked the search button.
How can I avoid the gridview displaying all rows before the search
button
was clicked?
Any Ideas? Thanks
Diane



Jul 31 '06 #4
Sorry, but I can't see where to set the Datasource property.
When I click on my gridview I see a DataSourceID property but no DataSource
property.
--
Diane
"Eliyahu Goldin" wrote:
I think, if you use DataSourceID property, the databinding will take place
automatically as your set the property. Instead use DataSource property.
Than you will have to call DataBind manually.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"Diane Truyens" <diane.truyens( removethis)@akt ivconsulting.be wrote in
message news:DB******** *************** ***********@mic rosoft.com...
Thanks Eliyahu for your answer. I'm new in ASP(.net) probably that's why
it
is not yet fully clear to me how to control databinding. I use an
objectdatasourc e with a tableadapter to populate my gridview. I presume
this
is an 'automated' databind? How can I prevent it and trigger the
databinding
when the search button is clicked?
--
Thanks
Diane
"Eliyahu Goldin" wrote:
Diane,

A gridview displays its content. If there is no content, there is nothing
to
display. In most scenarios a gridview gets populated as a result of
databinding. Probably, you are calling DataBind method for the gridview
or
for the page. In the latter case, replace a DataBind call for the page
with
DataBind calls to specific components that need databinding. And call
DataBind for the grid in the event handler for the search button.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"Diane Truyens" <diane.truyens( removethis)@akt ivconsulting.be wrote in
message news:98******** *************** ***********@mic rosoft.com...
Hi,

I have a form with textboxes, a search button and a gridview. The
textboxes
are filled with default values so that the gridview should return all
rows
but not before the user has had the chance to change some of the
textboxes
and has clicked the search button.
How can I avoid the gridview displaying all rows before the search
button
was clicked?
Any Ideas? Thanks
Diane


Jul 31 '06 #5
You can set it either in code-behind or in .aspx file in the Source view.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"Diane Truyens" <diane.truyens( removethis)@akt ivconsulting.be wrote in
message news:C8******** *************** ***********@mic rosoft.com...
Sorry, but I can't see where to set the Datasource property.
When I click on my gridview I see a DataSourceID property but no
DataSource
property.
--
Diane
"Eliyahu Goldin" wrote:
>I think, if you use DataSourceID property, the databinding will take
place
automaticall y as your set the property. Instead use DataSource property.
Than you will have to call DataBind manually.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"Diane Truyens" <diane.truyens( removethis)@akt ivconsulting.be wrote in
message news:DB******** *************** ***********@mic rosoft.com...
Thanks Eliyahu for your answer. I'm new in ASP(.net) probably that's
why
it
is not yet fully clear to me how to control databinding. I use an
objectdatasourc e with a tableadapter to populate my gridview. I
presume
this
is an 'automated' databind? How can I prevent it and trigger the
databinding
when the search button is clicked?
--
Thanks
Diane
"Eliyahu Goldin" wrote:

Diane,

A gridview displays its content. If there is no content, there is
nothing
to
display. In most scenarios a gridview gets populated as a result of
databinding. Probably, you are calling DataBind method for the
gridview
or
for the page. In the latter case, replace a DataBind call for the page
with
DataBind calls to specific components that need databinding. And call
DataBind for the grid in the event handler for the search button.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"Diane Truyens" <diane.truyens( removethis)@akt ivconsulting.be wrote
in
message news:98******** *************** ***********@mic rosoft.com...
Hi,

I have a form with textboxes, a search button and a gridview. The
textboxes
are filled with default values so that the gridview should return
all
rows
but not before the user has had the chance to change some of the
textboxes
and has clicked the search button.
How can I avoid the gridview displaying all rows before the search
button
was clicked?
Any Ideas? Thanks
Diane



Jul 31 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
13491
by: Jim Katz | last post by:
I have an application that updates a strongly typed data set at run time. I'd like to dynamically create a table that connects to a run time data table. For displaying the data, this works well. I just set the GridView.DataSource once, and call DataBind(); I'd like to drive the application from the GridView control, by including command buttons that allow editing of the data. Starting out simple, I have a DataTable with a boolean...
18
6517
by: Auto | last post by:
Hello, I would like to know how do display an image into a Gridview (ASP.NET 2.0) taken directly from a DataBase, NOT using an URL, like described in this article: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/GridViewEx06.asp I have NO URL, i have the binary image inside the DB, like the field "Photo" in the table "Employees" of the "NWIND.MDB" DataBase.
0
2417
by: John Smith | last post by:
ASP.Net 2.0 / C# / IIS 6 I have 2 pages. The master page consists of a tabbed menu created using the Menu and MultiView controls. Something like this: http://fredrik.nsquared2.com/viewpost.aspx?PostID=344&showfeedback=true The second page is a user control that contains a GridView control linked to a database table. What's supposed to happen is that the user clicks on a menu choice and an appropriate user control will load. For...
1
2167
by: H5N1 | last post by:
Hello I'm displaying report on a gridview through object data source which gets some parameters from ddl controls. Using sql profiler I've found out that even when controls are not yet set (by default they are set to empty string value, so I guess they should be interpreted as nulls) query (with empty parameters) is sent to sql server (it doesn't return anything). It causes unnecessary server load and slows down each postback, until all...
1
3528
by: jmdolinger | last post by:
Hi all, I'm a newbie to Atlas (and recently ASP.NET) after coming from a long Java background, also have done quite a bit with an Ajax.NET/ASP.NET 1.1 project, but it was basically all javascript, nothing really having to do with ASP.NET... I'm attempting to put together an application that consists of several GridView controls each bound to some xml data. Each table exists in its own update panel. The two effects I'm going for are:
5
2656
by: Randy Smith | last post by:
Hi ALL, I wonder if anyone has been using n-tier to bind to a GridView control by using the ObjectDataSource. This is our first OOP web application, and we have no tables. Right now we are simply working with objects in memory. So, it appears as though Microsoft requires that our datamapper classes reside inside a folder called "App_Code", and NO WHERE ELSE. So, has anyone successfully been able to place their datamappers in a...
3
7402
by: =?Utf-8?B?U21pdGE=?= | last post by:
Hello all, I have a gridview, and a label inside the <Columnsand ItemTemplate. The label is a hidden. I want to retrieve the value of this label on the gridview_OnPageIndexChanged event, but i seem to get a nullexception. Can anyone please tell me what iam doing wrong. When i do the "view source" option i do see the values in the label. thanks for all the help
1
2919
by: Danielle | last post by:
Greetings all and thanks in advance for any help you can provide. I am trying ultimately to get values from a gridview row when a checkbox on the row is checked. the problem I'm having is that after ticking the checkbox, the whole page refreshes (expectedly), the checkbox is unmarked and the response.write message displayed below never displays. It follows that if I uncomment the lines that try to capture the value in cell(3) and...
0
10111
by: =?Utf-8?B?ZWdzZGFy?= | last post by:
Hi, I have created a second gridview when customer clicks on select link with this code: Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand Select Case e.CommandName
0
9298
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9906
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9737
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8737
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6562
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5172
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3829
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2698
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.