By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,663 Members | 1,431 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,663 IT Pros & Developers. It's quick & easy.

Stop databinding on form load.

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.