__postback datagrid

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

  1. leonidmk

    leonidmk

    Joined:
    Aug 12, 2012
    Messages:
    2
    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. 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. Dave
    Replies:
    0
    Views:
    474
  2. BK Kim

    datagrid in datagrid

    BK Kim, Feb 23, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    570
    Alvin Bruney [MVP]
    Mar 2, 2004
  3. Peter Blum
    Replies:
    0
    Views:
    1,146
    Peter Blum
    Feb 25, 2004
  4. =?Utf-8?B?U3VyZXNo?=
    Replies:
    0
    Views:
    546
    =?Utf-8?B?U3VyZXNo?=
    Mar 2, 2004
  5. Andreas Klemt
    Replies:
    0
    Views:
    333
    Andreas Klemt
    Oct 8, 2003
Loading...

Share This Page