473,326 Members | 2,732 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,326 software developers and data experts.

How can I keep the dropdownlist from populating my gridview?

I have a gridview and a dropdownlist. If I change the ddl, the
gridview populates. That is what I want. But what I don't want is for
it to happen the first time they get to the page. I know I can add a
"Select Item," but is that the correct way to do it? I don't want it
to hit the database at all the first time the page loads. I have done
everything through visual studio and was trying to see if I could do
this with no code behind. Thanks.

Sep 10 '06 #1
6 1456
You need to check page property IsPostBack.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
<ne***********@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>I have a gridview and a dropdownlist. If I change the ddl, the
gridview populates. That is what I want. But what I don't want is for
it to happen the first time they get to the page. I know I can add a
"Select Item," but is that the correct way to do it? I don't want it
to hit the database at all the first time the page loads. I have done
everything through visual studio and was trying to see if I could do
this with no code behind. Thanks.

Sep 10 '06 #2
So I cannot do this solely using the GUI? I will have to code it in
the page_load? Thanks.
Eliyahu Goldin wrote:
You need to check page property IsPostBack.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
<ne***********@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
I have a gridview and a dropdownlist. If I change the ddl, the
gridview populates. That is what I want. But what I don't want is for
it to happen the first time they get to the page. I know I can add a
"Select Item," but is that the correct way to do it? I don't want it
to hit the database at all the first time the page loads. I have done
everything through visual studio and was trying to see if I could do
this with no code behind. Thanks.
Sep 12 '06 #3
Yes.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
<ne***********@gmail.comwrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
So I cannot do this solely using the GUI? I will have to code it in
the page_load? Thanks.
Eliyahu Goldin wrote:
>You need to check page property IsPostBack.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
<ne***********@gmail.comwrote in message
news:11**********************@b28g2000cwb.googleg roups.com...
>I have a gridview and a dropdownlist. If I change the ddl, the
gridview populates. That is what I want. But what I don't want is for
it to happen the first time they get to the page. I know I can add a
"Select Item," but is that the correct way to do it? I don't want it
to hit the database at all the first time the page loads. I have done
everything through visual studio and was trying to see if I could do
this with no code behind. Thanks.

Sep 12 '06 #4
Here's my problem. Since I put everything in the front I'm not sure
what to put in the page behind. It's got the objectdatasource control
in the "regular" .aspx page.

How can I tell the grid not to fire if all the "stuff" is in the .aspx
file?
Eliyahu Goldin wrote:
Yes.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
<ne***********@gmail.comwrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
So I cannot do this solely using the GUI? I will have to code it in
the page_load? Thanks.
Eliyahu Goldin wrote:
You need to check page property IsPostBack.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
<ne***********@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
I have a gridview and a dropdownlist. If I change the ddl, the
gridview populates. That is what I want. But what I don't want is for
it to happen the first time they get to the page. I know I can add a
"Select Item," but is that the correct way to do it? I don't want it
to hit the database at all the first time the page loads. I have done
everything through visual studio and was trying to see if I could do
this with no code behind. Thanks.
Sep 12 '06 #5
Are you asking how to add some code to an aspx page? You can add a
service-side script to the aspx page. Would you call it "in the front"? You
can't use asp.net without writing a line of code. This is a sort of
professional technology, it needs a professional approach.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
<ne***********@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
Here's my problem. Since I put everything in the front I'm not sure
what to put in the page behind. It's got the objectdatasource control
in the "regular" .aspx page.

How can I tell the grid not to fire if all the "stuff" is in the .aspx
file?
Eliyahu Goldin wrote:
>Yes.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
<ne***********@gmail.comwrote in message
news:11*********************@m73g2000cwd.googlegr oups.com...
So I cannot do this solely using the GUI? I will have to code it in
the page_load? Thanks.
Eliyahu Goldin wrote:
You need to check page property IsPostBack.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
<ne***********@gmail.comwrote in message
news:11**********************@b28g2000cwb.googleg roups.com...
I have a gridview and a dropdownlist. If I change the ddl, the
gridview populates. That is what I want. But what I don't want is
for
it to happen the first time they get to the page. I know I can add
a
"Select Item," but is that the correct way to do it? I don't want
it
to hit the database at all the first time the page loads. I have
done
everything through visual studio and was trying to see if I could do
this with no code behind. Thanks.


Sep 12 '06 #6
No, I guess I wasn't clear. Sorry. I don't mind coding. I shouldn't
have to in this case, at least I thought.

I ended up being right and half right to begin with. I added an item
to my dropdownlist (-- select item --) and then set the value to -1, as
there is no -1 in my database. I then set the AppendDataBoundItems
setting in the dropdownlist to true so that the new --select item--
wouldn't be lost when the dropdownlist was populated by items from the
database. No coding beyond the .aspx page necessary.

Eliyahu Goldin wrote:
Are you asking how to add some code to an aspx page? You can add a
service-side script to the aspx page. Would you call it "in the front"? You
can't use asp.net without writing a line of code. This is a sort of
professional technology, it needs a professional approach.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
<ne***********@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
Here's my problem. Since I put everything in the front I'm not sure
what to put in the page behind. It's got the objectdatasource control
in the "regular" .aspx page.

How can I tell the grid not to fire if all the "stuff" is in the .aspx
file?
Eliyahu Goldin wrote:
Yes.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
<ne***********@gmail.comwrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
So I cannot do this solely using the GUI? I will have to code it in
the page_load? Thanks.
Eliyahu Goldin wrote:
You need to check page property IsPostBack.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
<ne***********@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
I have a gridview and a dropdownlist. If I change the ddl, the
gridview populates. That is what I want. But what I don't want is
for
it to happen the first time they get to the page. I know I can add
a
"Select Item," but is that the correct way to do it? I don't want
it
to hit the database at all the first time the page loads. I have
done
everything through visual studio and was trying to see if I could do
this with no code behind. Thanks.
Sep 13 '06 #7

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

Similar topics

1
by: bill tie | last post by:
I have two dropDownLists A and B outside a gridView. A selection made in ddlA causes ddlB to be populated with data from the database. The gridView is populated with data according to a...
2
by: Phil Sandler | last post by:
I am trying to do something which seems (to me) to be very simple, and yet I can't seem to figure it out. I have a gridview and a formview. When a user clicks "select" in the gridview, the...
0
by: sgtmarcjones | last post by:
How do I access a dropdownlist that is nested within a Formview ItemTemplate Gridview Template? I want to see a label (lgbTimeKeep ! TextValue of ddlName dropdownlist) instead of a dropdownlist...
0
by: koonda | last post by:
Hi all, I have a Project due after one week. It is a web service project. I have a Web Form which communicates to the web service and this web service communicates to the database. I have all my...
3
by: Brian VanDyke | last post by:
I have to display a table with customer data (GridView). However, I want to be able to show DropDownList controls inside one of the columns, not just textbox controls. Is this possible? Is it...
0
by: lamolap | last post by:
i have 1 gridview , a dropdownlist inside a gridview and a commandfield of (edit, update and cancel) my gidview looks like this Edit Surname Initials ...
0
by: Fabrizio | last post by:
Hi all. I have a field in a gridview as templatefield which is a label in view mode and a dropdownlist in edit mode with his datasource. This gridview is inserted as templatefield in another...
2
by: RobertTheProgrammer | last post by:
Hi again, Okay, I decided the GridView is the way to go to solve my problem. But now I've got another problem. I've found plenty of examples about how to add a DropDownList item to the grid...
3
by: MU | last post by:
Hello I have a form with a dropdownlist on it and in the page_load I have this to populate it: Dim productsAdapter As New ProductsTableAdapter drpProducts.DataSource =...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.