Only you can help => select with gridview

Discussion in 'ASP .Net' started by Mr. SweatyFinger, Dec 25, 2006.

  1. 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.
     
    Mr. SweatyFinger, Dec 25, 2006
    #1
    1. Advertising

  2. Mr. SweatyFinger

    Ken Fine Guest

    your only hope Re: Only you can help => select with gridview

    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
     
    Ken Fine, Dec 26, 2006
    #2
    1. Advertising

  3. Mr. SweatyFinger

    Ken Fine Guest

    This is the specific link you want, Mister SweatyFinger:

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

    Have fun,
    -KF

    "Mr. SweatyFinger" <> wrote in message
    news:%...
    > 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.
    >
    >
    >
    >
     
    Ken Fine, Dec 26, 2006
    #3
  4. 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.
    >
    >
    >
    >
    >
     
    =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?=, Dec 26, 2006
    #4
  5. 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!
     
    Mr. SweatyFinger, Dec 27, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Doris Cox
    Replies:
    0
    Views:
    554
    Doris Cox
    Dec 2, 2003
  2. Richard Dixson
    Replies:
    1
    Views:
    530
    Joe Fallon
    May 18, 2004
  3. =?Utf-8?B?RGFiYmxlcg==?=

    select gridview row without using select button?

    =?Utf-8?B?RGFiYmxlcg==?=, Mar 3, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    101,607
    dch31969
    Feb 27, 2009
  4. SWu
    Replies:
    0
    Views:
    142
  5. palmiere
    Replies:
    1
    Views:
    452
    Erwin Moller
    Feb 9, 2004
Loading...

Share This Page