ASP.Net Grid Control Link Button

Discussion in 'ASP .Net Datagrid Control' started by Robin, Aug 2, 2004.

  1. Robin

    Robin Guest

    In an ASP.NET page that has a data grid with a bound column of link button.
    How can I reference the control and set properties for the link button at
    run time?
     
    Robin, Aug 2, 2004
    #1
    1. Advertisements

  2. Robin

    Matt Fischer Guest

    Hi Robin,

    Have a look at the ItemDataBound event. It basically fires every time a new
    row is rendered in your datagrid, so you can set values, add columns or
    change properties on any of the row items...

    to auto-wire the event in code behind:

    Private Sub myGrid_ItemDataBound(ByVal sender As Object, ByVal e As
    DataGridItemEventArgs) Handles myGrid.ItemDataBound

    '... your code here

    End Sub

    To add it to an inline aspx page, just create the above sub without the
    Handles clause and add this attribute to your datagrid:

    OnItemDataBound = "myGrid_ItemDataBound"

    "Robin" <> wrote in message
    news:...
    > In an ASP.NET page that has a data grid with a bound column of link

    button.
    > How can I reference the control and set properties for the link button at
    > run time?
    >
    >
     
    Matt Fischer, Aug 2, 2004
    #2
    1. Advertisements

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. Robin

    ASP.Net Grid Control Link Button

    Robin, Aug 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    521
    Moshfegh Hamedani
    Aug 2, 2004
  2. Yunus Emre ALPÖZEN [MCAD.NET]

    link data grid edit button

    Yunus Emre ALPÖZEN [MCAD.NET], May 9, 2005, in forum: ASP .Net
    Replies:
    13
    Views:
    896
    =?Utf-8?B?RWx0b24gVw==?=
    May 12, 2005
  3. John Smith
    Replies:
    0
    Views:
    535
    John Smith
    May 14, 2005
  4. parez
    Replies:
    1
    Views:
    820
    parez
    Jul 19, 2006
  5. RCorona
    Replies:
    1
    Views:
    284
    Al Cadalzo
    Jan 1, 2005
  6. Jim Gilligan
    Replies:
    0
    Views:
    248
    Jim Gilligan
    Sep 1, 2005
  7. JumpingMattFlash

    ASP.NET 2.0 Link Button & Runtime Click Handler

    JumpingMattFlash, Aug 11, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    390
    JumpingMattFlash
    Aug 11, 2006
  8. Dustin II.
    Replies:
    1
    Views:
    550
Loading...