Only you can help => select with gridview

M

Mr. SweatyFinger

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.
 
K

Ken Fine

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
 
G

Guest

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â€)
 
M

Mr. SweatyFinger

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top