473,473 Members | 1,425 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Only you can help => select with gridview

My gridview is ties to a table of states. These are United States states,
from the greatest land in the world.
The numeric column is an autonumber, hopefully you've heard of that. If not
please google "autonumber" before proceeding.
Here is a small sample, so you can clue into what I am doing:

ID State
__ ____________
1 california
2 new york
3 tennessee
4 idaho
5 kentucky
6 florida

If you are with me so far, great. Now I want to have it so when the guy
clicks on a row, the page changes to a list of cities in the state.
But the real kicker here is that I am not doing it with the ID. Oh, no.. you
see, I am thinking out of the box here, and i expect you to do the same.

I am using the state name as the value that gets passed off to the cities
control.

Now I have one problem. How to accomplish? I hate to make a fool out of the
Microsoft Engineers, but I think I may have come up with an idea that they
can not wrap their heads around. I think they did not anticipate this sort
of thing, because I can find no solution.

I thought i would ask you folks, and if you come up with nothing, I very
well may send this off to Microsoft as a "bug", and hopefully they will name
it after me like a new star in the sky.

OK, so get together in small groups of 5 or 6 people each, and let me know
what you come up with by the end of the day.
I know that some of you are smarter than others, but I'm serious when i say
i want you to try to work together on this.

Together we can accomplish something special.

Now get to it. 'Nuff said.


Dec 25 '06 #1
4 1595
LOL. It isn't clear to me whether you're joking here or not, but in the off
chance that there's an authentic need behind your abundant wit and wisdom, I
will try to help.

Why do you want to use a string value -- the state name -- instead of an
integer primary key?

Scott Michell's "extensive examination of the datagrid[gridview]" will tell
you how to accomplish the master-detail scenario you're envisioning. You can
also look at this newer list of tutorials:

http://www.asp.net/Learn/DataAccess/

Look at the Master/Detail stuff, read it, and understand it before bothering
the busy Microsoft Engineers. The link above will tell you how to make what
you want to make.

-KF
Dec 26 '06 #2
This is the specific link you want, Mister SweatyFinger:

http://www.asp.net/learn/dataaccess/....aspx?tabid=63

Have fun,
-KF

"Mr. SweatyFinger" <sw@sw1finger.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
My gridview is ties to a table of states. These are United States states,
from the greatest land in the world.
The numeric column is an autonumber, hopefully you've heard of that. If
not please google "autonumber" before proceeding.
Here is a small sample, so you can clue into what I am doing:

ID State
__ ____________
1 california
2 new york
3 tennessee
4 idaho
5 kentucky
6 florida

If you are with me so far, great. Now I want to have it so when the guy
clicks on a row, the page changes to a list of cities in the state.
But the real kicker here is that I am not doing it with the ID. Oh, no..
you see, I am thinking out of the box here, and i expect you to do the
same.

I am using the state name as the value that gets passed off to the cities
control.

Now I have one problem. How to accomplish? I hate to make a fool out of
the Microsoft Engineers, but I think I may have come up with an idea that
they can not wrap their heads around. I think they did not anticipate
this sort of thing, because I can find no solution.

I thought i would ask you folks, and if you come up with nothing, I very
well may send this off to Microsoft as a "bug", and hopefully they will
name it after me like a new star in the sky.

OK, so get together in small groups of 5 or 6 people each, and let me know
what you come up with by the end of the day.
I know that some of you are smarter than others, but I'm serious when i
say i want you to try to work together on this.

Together we can accomplish something special.

Now get to it. 'Nuff said.


Dec 26 '06 #3
On the chance i may be making a fool of myself by responding seriously to
your narrative. I’m guessing it’s the data key you are having an issue with.
Guessing further, the data key in your gridview is the autonumber. You can
have more that one item for a datakey.
on row command:
Me.GridView1.DataKeys(e.CommandArgument).Item(0)), ‘ID
Me.GridView1.DataKeys(e.CommandArgument).Item(1)), ‘state

Other than that I’m not sure what the problem is.
(a citizen of the United States of America, and as you noted: “greatest land
in the world”)

--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
"Mr. SweatyFinger" wrote:
My gridview is ties to a table of states. These are United States states,
from the greatest land in the world.
The numeric column is an autonumber, hopefully you've heard of that. If not
please google "autonumber" before proceeding.
Here is a small sample, so you can clue into what I am doing:

ID State
__ ____________
1 california
2 new york
3 tennessee
4 idaho
5 kentucky
6 florida

If you are with me so far, great. Now I want to have it so when the guy
clicks on a row, the page changes to a list of cities in the state.
But the real kicker here is that I am not doing it with the ID. Oh, no.. you
see, I am thinking out of the box here, and i expect you to do the same.

I am using the state name as the value that gets passed off to the cities
control.

Now I have one problem. How to accomplish? I hate to make a fool out of the
Microsoft Engineers, but I think I may have come up with an idea that they
can not wrap their heads around. I think they did not anticipate this sort
of thing, because I can find no solution.

I thought i would ask you folks, and if you come up with nothing, I very
well may send this off to Microsoft as a "bug", and hopefully they will name
it after me like a new star in the sky.

OK, so get together in small groups of 5 or 6 people each, and let me know
what you come up with by the end of the day.
I know that some of you are smarter than others, but I'm serious when i say
i want you to try to work together on this.

Together we can accomplish something special.

Now get to it. 'Nuff said.


Dec 26 '06 #4
This is terrific. But what the hell does it mean?
What am I supposed to do with
Me.GridView1.DataKeys(e.CommandArgument).Item(0)), 'ID
Me.GridView1.DataKeys(e.CommandArgument).Item(1)), 'state
Play it on my IPOD?

Now I need you to stop treating me like a complete idiot, and give me
something I can use.

Back to work for you!
Dec 27 '06 #5

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

Similar topics

6
by: Terry | last post by:
Good morning! How do I determine which SELECT button was clicked in a GridView? The multiple SELECT buttons will be used for an application approval process. Thank you in advance for your...
1
by: syl | last post by:
Hello I am trying to create a "easy to use" gridview with filters (dropdownlist in headers), sorting...and much more.... In order to do that, i prefer to use a objectdatasource (ODS) beacause...
2
by: David | last post by:
I have a gridView that sometimes only shows the header and not the detail. Does anyone know how this can happen? Also, if I change the SelectCommand string using code do I need to use Databind()...
13
by: Mich | last post by:
Hi, 1) i defined a html line in the aspx file like this but it's still visible:: <hr id="hr1" visible="false" /> So i defined it like this and now it's hidden: <hr id="hr1"...
4
by: Randy Smith | last post by:
Hi, I would like to limit my user selection to only one row in the GridView at a time. Is there any way to set this? TIA, Randy
2
by: Andy B | last post by:
I don't know if this is even working or not but here is the problem. I have a gridview that I databound to a dictionary<string, stringcollection: Contract StockContract = new Contract();...
1
by: =?Utf-8?B?R3JlZw==?= | last post by:
I have a <asp:GridViewcontrol that is populated with records. The first column I display contains a "UserID" DataField. I've created my column using the following code: <asp:BoundField...
1
by: =?Utf-8?B?SkI=?= | last post by:
Hi, I have two buttons that are within the template field, of a gridview. The gridview is in a web control. I am able to deletage most of the events that the gridview fires, with the code...
4
by: justice750 | last post by:
Hi All, I am using a FormView control. The allows me to update records in the database. However, when a database field is null I can not update the field on the form. It works fine when the field...
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
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...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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 projectplanning, coding, testing,...
1
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
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.