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

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

    ASP.Net Grid Control Link Button

    Robin, Aug 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    438
    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:
    700
    =?Utf-8?B?RWx0b24gVw==?=
    May 12, 2005
  3. John Smith
    Replies:
    0
    Views:
    468
    John Smith
    May 14, 2005
  4. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    816
    Kevin Spencer
    May 17, 2005
  5. RCorona
    Replies:
    1
    Views:
    160
    Al Cadalzo
    Jan 1, 2005
Loading...

Share This Page