Accessing data from C# code-behind in the ItemDataBound Event

Discussion in 'ASP .Net Datagrid Control' started by hchattaway@bugcentral.com, Jan 6, 2005.

  1. Guest

    Hello:

    If I want to access a particular column of data that is bound to a
    datagrid from within the ItemDataBound Event, how would I do that?

    I am trying to construct a NavigationURL on the fly based on multiple
    fields. I am creating a URL with multiple parameters....

    ?edititem.aspx?parm1=x&parm2=y

    X and Y I want to populate with data from the current row...
    Thanks
    Harold
     
    , Jan 6, 2005
    #1
    1. Advertising

  2. Harold,

    Use e.Item.Cells(i) where e is the event parameter and i is the column
    number.

    Eliyahu

    <> wrote in message
    news:...
    > Hello:
    >
    > If I want to access a particular column of data that is bound to a
    > datagrid from within the ItemDataBound Event, how would I do that?
    >
    > I am trying to construct a NavigationURL on the fly based on multiple
    > fields. I am creating a URL with multiple parameters....
    >
    > ?edititem.aspx?parm1=x&parm2=y
    >
    > X and Y I want to populate with data from the current row...
    > Thanks
    > Harold
    >
     
    Eliyahu Goldin, Jan 6, 2005
    #2
    1. Advertising

  3. Elton Wang Guest

    Hi,

    Please see my anwser to ?how to get to the underlying data
    in a datagrid control posted on Dec. 16/04

    Elton Wang


    >-----Original Message-----
    >Hello:
    >
    >If I want to access a particular column of data that is

    bound to a
    >datagrid from within the ItemDataBound Event, how would I

    do that?
    >
    >I am trying to construct a NavigationURL on the fly based

    on multiple
    >fields. I am creating a URL with multiple parameters....
    >
    >?edititem.aspx?parm1=x&parm2=y
    >
    >X and Y I want to populate with data from the current

    row...
    >Thanks
    >Harold
    >
    >.
    >
     
    Elton Wang, Jan 7, 2005
    #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. Ben Miller [msft]

    Re: Code Behind vs. no code behind: error

    Ben Miller [msft], Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    654
    Alphonse Giambrone
    Jun 28, 2003
  2. GaryDean
    Replies:
    1
    Views:
    8,769
    Walter Wang [MSFT]
    Aug 18, 2006
  3. John

    Non-code behind to code behind

    John, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    537
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 19, 2007
  4. Nathan Sokalski
    Replies:
    1
    Views:
    376
    Eliyahu Goldin
    May 27, 2007
  5. NH
    Replies:
    2
    Views:
    574
    Andrew L. Van Slaars
    Dec 17, 2004
Loading...

Share This Page