Home All Groups Group Topic Archive Search About

Dependent GridViews And CommandArguments

Author
17 Jan 2006 4:33 AM
beaudetious
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

Author
17 Jan 2006 12:30 PM
Christopher Reed
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."

Show quoteHide quote
"beaudetious" <beaudeti***@discussions.microsoft.com> wrote in message
news:46EDC9DE-29EF-4569-86F6-2524246461AA@microsoft.com...
>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
Author
17 Jan 2006 1:16 PM
beaudetious
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

Show quoteHide quote
"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" <beaudeti***@discussions.microsoft.com> wrote in message
> news:46EDC9DE-29EF-4569-86F6-2524246461AA@microsoft.com...
> >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
>
>
>
Author
17 Jan 2006 2:41 PM
Phillip Williams
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
Show quoteHide quote
"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
Author
17 Jan 2006 3:59 PM
beaudetious
That looks like an excellent suggestion.  I'll play with it tonight.  Thanks.

Show quoteHide quote
"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