473,387 Members | 1,495 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,387 software developers and data experts.

Stop databinding on form load.

I have a web form with a GridView and a DataSource.
As soon as the page loads, my GridView is populated.
My form has several querying capabilties, which on postback repopulates
my GridView.
What I want is to stop the data binding when my form first starts up, so
the query components are clear and no default data is returned when the
user first loads up.

Is this possible and if so, how could I go about doing this?

Regards,

Steven

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
4 2665
Just overwrite the DataBind() method in your Page?
"Steven Blair" <st**********@btinternet.com> schrieb im Newsbeitrag
news:uo**************@TK2MSFTNGP12.phx.gbl...
I have a web form with a GridView and a DataSource.
As soon as the page loads, my GridView is populated.
My form has several querying capabilties, which on postback repopulates
my GridView.
What I want is to stop the data binding when my form first starts up, so
the query components are clear and no default data is returned when the
user first loads up.

Is this possible and if so, how could I go about doing this?

Regards,

Steven

*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #2
What do you mean by overwrite?

On the Page_load there is no call to .DataBind since I am using a
GridView and a DataSource.

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3
if(IsPostBack)
{
//do stuff here
}

--

Derek Davis
dd******@gmail.com

"Steven Blair" <st**********@btinternet.com> wrote in message
news:uo**************@TK2MSFTNGP12.phx.gbl...
I have a web form with a GridView and a DataSource.
As soon as the page loads, my GridView is populated.
My form has several querying capabilties, which on postback repopulates
my GridView.
What I want is to stop the data binding when my form first starts up, so
the query components are clear and no default data is returned when the
user first loads up.

Is this possible and if so, how could I go about doing this?

Regards,

Steven

*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #4
Thanks for the help so far, but the problem is I don't have a call to
DataBind in he Page_Load because I am using a SQLDataSource and a
GridView.

I need to somehow cancel this DataBinding which happens when my page is
created.

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #5

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

Similar topics

2
by: Colin Robinson | last post by:
Help please I have an example class called Person with 2 public properties Firstname and Lastname, I cant create a textbox on an asp.net form bound to the Person.Firstname property Can...
3
by: Stan | last post by:
I am looking for the best solution for this scenario: ASP.NET needs display an editable form with 20 textboxes. Data source is xml. Xml must be updated. if user clicks Update button on the form....
3
by: Tom McLaughlin | last post by:
I am new to vb.net and I am running into problems understanding DataBinding and its concept. The only examples I find are always talk about Web design, I only want to use this data on my...
7
by: Richard | last post by:
I have a form with seven tapages. These span only one record with a large number of fields (textboxes). On Tabpage1 I display a number of read-only text boxes. This displays information about...
7
by: Justin Hoffman | last post by:
I am new to vb.net programming and am just exploring the way databinding works with Windows forms and am having trouble with some fairly basic customization of data entry. The form uses the...
8
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
9
by: Nathan Sokalski | last post by:
I have a very simple UserControl which contains an Image and a Label, which I use to display an image with a caption. I am using this control inside a DataList, setting the two Public variables...
2
by: Wan | last post by:
Hi, I have a vb.net form with some controls on it, let says, combobox, text, comment, etc. databinding to a dataset. I also have a save button that when click will update the changes to a...
2
by: Dustin Davis | last post by:
I've been having problems with databinding. I've created a simple solution to emulate the problem I can't figure out. Basically, I have a TextBox bound to a property in an object. When the property...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
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...
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,...

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.