473,503 Members | 12,516 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disable objectdatasource-control

Hi,

I have a search page with a textbox, button, gridview and a
objectdatasource. It works great with one problem. When the page loads the
first time the objectdatasource calls the select-method and because its
bound to the textbox (search string) and the textbox is empty it display all
records. This is not the way I wnat it to work - however I want the user to
be able to make a blank search (and return all items).

Can I "disable" the datasource control on first load?

Thanks
Apr 10 '06 #1
5 3136
Michael,

There is nothing wrong with a switch if it is needed.

But in the way you tell it am I asking myself why are you binding it in the
load.
(or are you binding it by the designer, have than just a look in the
designer created code, and cut and paste that part there where you need it)

Cor
"Michael Fällgreen" <mf*@ulle.se> schreef in bericht
news:eH**************@TK2MSFTNGP03.phx.gbl...
Hi,

I have a search page with a textbox, button, gridview and a
objectdatasource. It works great with one problem. When the page loads the
first time the objectdatasource calls the select-method and because its
bound to the textbox (search string) and the textbox is empty it display
all records. This is not the way I wnat it to work - however I want the
user to be able to make a blank search (and return all items).

Can I "disable" the datasource control on first load?

Thanks

Apr 10 '06 #2
Hi

Im binding in the designer! How can I "make a switch"?

Thanks
"Cor Ligthert [MVP]" <no************@planet.nl> skrev i en meddelelse
news:%2****************@TK2MSFTNGP04.phx.gbl...
Michael,

There is nothing wrong with a switch if it is needed.

But in the way you tell it am I asking myself why are you binding it in
the load.
(or are you binding it by the designer, have than just a look in the
designer created code, and cut and paste that part there where you need
it)

Cor
"Michael Fällgreen" <mf*@ulle.se> schreef in bericht
news:eH**************@TK2MSFTNGP03.phx.gbl...
Hi,

I have a search page with a textbox, button, gridview and a
objectdatasource. It works great with one problem. When the page loads
the first time the objectdatasource calls the select-method and because
its bound to the textbox (search string) and the textbox is empty it
display all records. This is not the way I wnat it to work - however I
want the user to be able to make a blank search (and return all items).

Can I "disable" the datasource control on first load?

Thanks


Apr 10 '06 #3
Michael,

If you are binding in the designer than the binding is done while
initializing.

What version are you using? (1.x or 2.0)

Cor

"Michael Fällgreen" <mf*@ulle.se> schreef in bericht
news:e5**************@TK2MSFTNGP03.phx.gbl...
Hi

Im binding in the designer! How can I "make a switch"?

Thanks
"Cor Ligthert [MVP]" <no************@planet.nl> skrev i en meddelelse
news:%2****************@TK2MSFTNGP04.phx.gbl...
Michael,

There is nothing wrong with a switch if it is needed.

But in the way you tell it am I asking myself why are you binding it in
the load.
(or are you binding it by the designer, have than just a look in the
designer created code, and cut and paste that part there where you need
it)

Cor
"Michael Fällgreen" <mf*@ulle.se> schreef in bericht
news:eH**************@TK2MSFTNGP03.phx.gbl...
Hi,

I have a search page with a textbox, button, gridview and a
objectdatasource. It works great with one problem. When the page loads
the first time the objectdatasource calls the select-method and because
its bound to the textbox (search string) and the textbox is empty it
display all records. This is not the way I wnat it to work - however I
want the user to be able to make a blank search (and return all items).

Can I "disable" the datasource control on first load?

Thanks



Apr 10 '06 #4
2.0

Michael
"Cor Ligthert [MVP]" <no************@planet.nl> skrev i en meddelelse
news:ui**************@TK2MSFTNGP04.phx.gbl...
Michael,

If you are binding in the designer than the binding is done while
initializing.

What version are you using? (1.x or 2.0)

Cor

"Michael Fällgreen" <mf*@ulle.se> schreef in bericht
news:e5**************@TK2MSFTNGP03.phx.gbl...
Hi

Im binding in the designer! How can I "make a switch"?

Thanks
"Cor Ligthert [MVP]" <no************@planet.nl> skrev i en meddelelse
news:%2****************@TK2MSFTNGP04.phx.gbl...
Michael,

There is nothing wrong with a switch if it is needed.

But in the way you tell it am I asking myself why are you binding it in
the load.
(or are you binding it by the designer, have than just a look in the
designer created code, and cut and paste that part there where you need
it)

Cor
"Michael Fällgreen" <mf*@ulle.se> schreef in bericht
news:eH**************@TK2MSFTNGP03.phx.gbl...
Hi,

I have a search page with a textbox, button, gridview and a
objectdatasource. It works great with one problem. When the page loads
the first time the objectdatasource calls the select-method and because
its bound to the textbox (search string) and the textbox is empty it
display all records. This is not the way I wnat it to work - however I
want the user to be able to make a blank search (and return all items).

Can I "disable" the datasource control on first load?

Thanks



Apr 10 '06 #5
Michael,

GridView I was aspectiong you were using windowsforms.

In this case I would simple try in the load event

if not ispostback then
GridView1.Datasource = nothing
end if

Not tried, I would not know why this would not work.

Cor
Apr 10 '06 #6

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

Similar topics

0
1567
by: ber.janssens | last post by:
Hi, I am trying the new ObjectDataSource from ASP.NET 2.0. I connected a Gridview with ObjectDataSource which is connected to a webservice which returns a DataSet. In the Webmethod I return...
0
1479
by: Eiriken | last post by:
Hello everyone, I am using ASP.NET 2 and trying to bind a objectdatasource to a gridview. By doing this the most common way by adding an objectdatasource to the page and by using the wizard to...
1
1919
by: Jürgen Bayer | last post by:
Hi, I just tried out the ObjectDataSource of ASP.NET 2.0. A simple application works with a GridView bound to an ObjectDataSource. The ObjectDataSource is set to a (factory) class...
0
1864
by: Northern | last post by:
Hello, I have some trouble to declare and instantiate dynamically an ObjectDataSource in the codebehind file. The idea is to bind the objectdatasource to a gridview and have automate sorting and...
2
3904
by: J055 | last post by:
Hi I have a method with the following signature: public bool UpdateSetAccounts(int items) { } How do I pass a collection of selected values in a ListBox to this ObjectDataSource...
1
9776
by: Roger | last post by:
Hi all On a page I am using a repeater which is linked to an ObjectDataSource (same page): <asp:Repeater ID="VideoListNewestRepeater" runat="server" DataSourceID="VideoListNewestDataSource">...
0
2165
by: GMartin | last post by:
I have a pop-up form with a three columned Grid that has checkboxes in a Template Column in the first/left-most column. (The form is to allow users to select "Members" of a group, where they check...
0
1617
by: =?Utf-8?B?RGVuaXMgU29oZXQ=?= | last post by:
Hi all, I've created a new project to test ObjectDataSource component. I've just added a new objectdatasource, configured it (linked to a table) etc ... It works fine on localhost, i can...
0
5498
by: Phillip Ian | last post by:
Tried this over in CSharp.General and didn't get anything, so I thought I'd try again here. If there's an AJAX specific group I could ask this in, please let me know...I did look. I'm trying to...
3
11153
by: btreddy | last post by:
Hii all, I've a problem regarding passing select parameters to objectdatasource from code behind. i would like to pass the select parameters to a objectdatasource ..not in the selecting or...
0
7098
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
7296
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
7364
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
5604
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,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4696
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...
0
3174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
405
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...

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.