Get GridView's datasource after Post Back

Discussion in 'ASP .Net' started by phil.a.jenkins@gmail.com, Sep 13, 2006.

  1. Guest

    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 :)
     
    , Sep 13, 2006
    #1
    1. Advertising

  2. Guest

    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
     
    , Sep 13, 2006
    #2
    1. Advertising

  3. You can persist the dataset in a session variable.

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


    <> wrote in message
    news:...
    > 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 :)
    >
     
    Eliyahu Goldin, Sep 13, 2006
    #3
    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. Joby
    Replies:
    0
    Views:
    1,656
  2. Greg Ramsey
    Replies:
    0
    Views:
    773
    Greg Ramsey
    Mar 19, 2006
  3. guptha
    Replies:
    0
    Views:
    386
    guptha
    Aug 4, 2006
  4. =?Utf-8?B?Z29yaWxsYQ==?=
    Replies:
    1
    Views:
    810
    Masudur
    May 25, 2007
  5. jobs
    Replies:
    2
    Views:
    1,696
Loading...

Share This Page