473,395 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 4083
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)@aktivconsulting.bewro te in
message news:98**********************************@microsof t.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
objectdatasource 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)@aktivconsulting.bewro te in
message news:98**********************************@microsof t.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)@aktivconsulting.bewro te in
message news:DB**********************************@microsof t.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
objectdatasource 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)@aktivconsulting.bewro te in
message news:98**********************************@microsof t.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)@aktivconsulting.bewro te in
message news:DB**********************************@microsof t.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
objectdatasource 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)@aktivconsulting.bewro te in
message news:98**********************************@microsof t.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)@aktivconsulting.bewro te in
message news:C8**********************************@microsof t.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
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)@aktivconsulting.bewro te in
message news:DB**********************************@microsof t.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
objectdatasource 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)@aktivconsulting.bewro te
in
message news:98**********************************@microsof t.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
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. ...
18
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: ...
0
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: ...
1
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...
1
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...
5
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...
3
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...
1
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...
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.