__postback datagrid

Discussion in 'ASP .Net Datagrid Control' started by leonidmk, Aug 19, 2012.

  1. leonidmk

    leonidmk

    Joined:
    Aug 12, 2012
    Messages:
    2
    Likes Received:
    0
    I want my datagrid rows to be clickable, so that a button column is
    fired when my user clicks anywhere on a row. Using Google, I figured out
    how to do it, but it only works after row 8. From row 9 on, the next
    page opens properly, but clicking rows 1 through 8 does nothing - the
    dopostback fires, but the page does not change. If I remove this code,
    the button column works fine. This sub seems to be disabling rows 1-8
    for some reason.

    Here's my sub:

    Protected Sub DataGrid_ItemCreated(ByVal sender As Object, ByVal e As
    System.Web.UI.WebControls.DataGridItemEventArgs)
    e.Item.Attributes.Add("onclick",
    "javascript:__doPostBack('dgrDataGrid$ctl" & _
    (e.Item.ItemIndex + 2) & _
    "$ctl00','')")
    end sub
     
    leonidmk, Aug 19, 2012
    #1
    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. Dave
    Replies:
    0
    Views:
    613
  2. BK Kim

    datagrid in datagrid

    BK Kim, Feb 23, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    760
    Alvin Bruney [MVP]
    Mar 2, 2004
  3. Amar
    Replies:
    0
    Views:
    656
  4. matthew schouppe
    Replies:
    3
    Views:
    2,542
    Scott Allen
    Apr 30, 2004
  5. Patrick Delifer

    Updating Datagrid from outside datagrid

    Patrick Delifer, May 3, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    423
    Natty Gur
    May 4, 2004
  6. RSB
    Replies:
    2
    Views:
    1,371
  7. Martin Marinov
    Replies:
    2
    Views:
    5,703
  8. Andreas Klemt
    Replies:
    0
    Views:
    501
    Andreas Klemt
    Oct 8, 2003
Loading...