Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Get GridView's datasource after Post Back

Reply
Thread Tools

Get GridView's datasource after Post Back

 
 
phil.a.jenkins@gmail.com
Guest
Posts: n/a
 
      09-13-2006
Hello

I have a GridView which is bound to a standard DataSet on Page_Load.

E.g

Grid.DataSource = dataSet;
Grid.DataBind();


I have added columns manually in the aspx source, and one of them is a
ButtonField, which is hooked up to a _RowCommand event handler.

What I need to do is to be able to get values out of the original
dataset when the command button is clicked, note they are not displayed
in the gridview itself. Is there a way of doing this?

Apologies if this makes no sense, ASP.NET is still foreign to me

 
Reply With Quote
 
 
 
 
phil.a.jenkins@gmail.com
Guest
Posts: n/a
 
      09-13-2006
Thanks Eliyahu for your response

The way the web app has been developed means that we can't use session
variables (any session information is stored in the DB) so any
Context.Session stuff is out of bounds.

I basically need to be able to set the CommandArgument of a LinkButton
in the GridView to have a value which is an ID extracted from the
DataSet, instead of the default, which is the grid's row ID. Is there
an event I can use to handle this?

Many thanks

Phil

 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      09-13-2006
You can persist the dataset in a session variable.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Hello
>
> I have a GridView which is bound to a standard DataSet on Page_Load.
>
> E.g
>
> Grid.DataSource = dataSet;
> Grid.DataBind();
>
>
> I have added columns manually in the aspx source, and one of them is a
> ButtonField, which is hooked up to a _RowCommand event handler.
>
> What I need to do is to be able to get values out of the original
> dataset when the command button is clicked, note they are not displayed
> in the gridview itself. Is there a way of doing this?
>
> Apologies if this makes no sense, ASP.NET is still foreign to me
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How does a dynamic control load post back data across post back?? =?Utf-8?B?Z29yaWxsYQ==?= ASP .Net 1 05-25-2007 05:02 AM
Unable to get dynamically created controls after post back guptha ASP .Net 0 08-04-2006 02:50 PM
How can I send back(Post back) some values from client machine Joby ASP .Net 0 05-14-2004 04:19 AM
Re: Hey Kathy, a while back didn't you post a little thing to help remember IRQ and DMA assignments? If so please re-post. Geoff A+ Certification 1 02-09-2004 12:14 AM
Post post post. Shel-hed Computer Support 2 11-08-2003 07:41 AM



Advertisments