Dependent GridViews And CommandArguments

Discussion in 'ASP .Net Web Controls' started by beaudetious, Jan 17, 2006.

  1. beaudetious

    beaudetious Guest

    I have two gridviews. The first one has a column that contains an
    ImageButton with a commandargument that is set in the RowDataBound event for
    that gridview. What I want to happen is that when a user clicks the
    ImageButton on a row in the first grid, somehow the commandargument will be
    read and used as a parameter in a select statement used to populate the
    second gridview.

    I've not seen anything like this and it's driving me batty.

    Thanks,
    beaudetious
     
    beaudetious, Jan 17, 2006
    #1
    1. Advertising

  2. Look at examples of a GridView linked to a DetailsView and substitute the
    DetailsView for your second GridView. There are examples of this in the
    ASP.NET Quick Start Tutorials available through www.asp.net and the .NET
    SDK.
    --
    Christopher A. Reed
    "The oxen are slow, but the earth is patient."

    "beaudetious" <> wrote in message
    news:...
    >I have two gridviews. The first one has a column that contains an
    > ImageButton with a commandargument that is set in the RowDataBound event
    > for
    > that gridview. What I want to happen is that when a user clicks the
    > ImageButton on a row in the first grid, somehow the commandargument will
    > be
    > read and used as a parameter in a select statement used to populate the
    > second gridview.
    >
    > I've not seen anything like this and it's driving me batty.
    >
    > Thanks,
    > beaudetious
     
    Christopher Reed, Jan 17, 2006
    #2
    1. Advertising

  3. beaudetious

    beaudetious Guest

    Christopher,

    Most of the examples I've seen use some form of the Select command. My
    specific case uses the commandargument from an ImageButton as a parameter in
    a stored procedure. That's the tricky part for me.

    Brian

    "Christopher Reed" wrote:

    > Look at examples of a GridView linked to a DetailsView and substitute the
    > DetailsView for your second GridView. There are examples of this in the
    > ASP.NET Quick Start Tutorials available through www.asp.net and the .NET
    > SDK.
    > --
    > Christopher A. Reed
    > "The oxen are slow, but the earth is patient."
    >
    > "beaudetious" <> wrote in message
    > news:...
    > >I have two gridviews. The first one has a column that contains an
    > > ImageButton with a commandargument that is set in the RowDataBound event
    > > for
    > > that gridview. What I want to happen is that when a user clicks the
    > > ImageButton on a row in the first grid, somehow the commandargument will
    > > be
    > > read and used as a parameter in a select statement used to populate the
    > > second gridview.
    > >
    > > I've not seen anything like this and it's driving me batty.
    > >
    > > Thanks,
    > > beaudetious

    >
    >
    >
     
    beaudetious, Jan 17, 2006
    #3
  4. You might change the control parameter to refer to a hidden TextBox that is
    being populated from that button, as I did in this
    demo:http://www.webswapp.com/CodeSamples/aspnet20/GridView_6c.aspx
    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "beaudetious" wrote:

    > I have two gridviews. The first one has a column that contains an
    > ImageButton with a commandargument that is set in the RowDataBound event for
    > that gridview. What I want to happen is that when a user clicks the
    > ImageButton on a row in the first grid, somehow the commandargument will be
    > read and used as a parameter in a select statement used to populate the
    > second gridview.
    >
    > I've not seen anything like this and it's driving me batty.
    >
    > Thanks,
    > beaudetious
     
    Phillip Williams, Jan 17, 2006
    #4
  5. beaudetious

    beaudetious Guest

    That looks like an excellent suggestion. I'll play with it tonight. Thanks.

    "Phillip Williams" wrote:

    > You might change the control parameter to refer to a hidden TextBox that is
    > being populated from that button, as I did in this
    > demo:http://www.webswapp.com/CodeSamples/aspnet20/GridView_6c.aspx
    > --
    > HTH,
    > Phillip Williams
    > http://www.societopia.net
    > http://www.webswapp.com
    >
    >
    > "beaudetious" wrote:
    >
    > > I have two gridviews. The first one has a column that contains an
    > > ImageButton with a commandargument that is set in the RowDataBound event for
    > > that gridview. What I want to happen is that when a user clicks the
    > > ImageButton on a row in the first grid, somehow the commandargument will be
    > > read and used as a parameter in a select statement used to populate the
    > > second gridview.
    > >
    > > I've not seen anything like this and it's driving me batty.
    > >
    > > Thanks,
    > > beaudetious
     
    beaudetious, Jan 17, 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. Jan Vetterli

    Button with multiple CommandArguments??

    Jan Vetterli, Dec 17, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    22,123
    robertbruder
    Jul 26, 2007
  2. ChemFinder
    Replies:
    0
    Views:
    902
    ChemFinder
    Apr 1, 2006
  3. Eddie
    Replies:
    0
    Views:
    324
    Eddie
    Jul 11, 2006
  4. trint

    Gridviews and horizontal scroll...

    trint, May 7, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    373
    trint
    May 7, 2007
  5. puzzlecracker
    Replies:
    1
    Views:
    524
    James Kanze
    Aug 7, 2008
Loading...

Share This Page