Datagrid PageIndexChanged event not firing

Discussion in 'ASP .Net Web Controls' started by Vijay, Aug 24, 2005.

  1. Vijay

    Vijay Guest

    Hi All,

    I have a data grid in my user contro, on ItemCreated event i am adding
    attributes to the grid's paging navigation buttons [i.e 1 2 3 etc]. After
    adding the "OnClick" attribute, if i click the navigation button the
    "PageIndexChanged" event is not firing. If remove the onclick attribute, then
    the "PageIndexChanged" event is firing.

    private void dgAdjFactor_ItemCreated(object sender,
    System.Web.UI.WebControls.DataGridItemEventArgs e)
    {
    if(e.Item.ItemType == ListItemType.Pager)
    {
    foreach(Control NavButtons in e.Item.Cells[0].Controls)

    if(NavButtons.GetType().ToString().Equals("System.Web.UI.WebControls.DataGridLinkButton"))
    {
    ((LinkButton)NavButtons).Attributes.Add("OnClick",
    "javascript:hidIsControlPostBack.value='yes';");
    }
    }
    }
    }
    Vijay, Aug 24, 2005
    #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. Rick Strahl [MVP]

    PageIndexChanged not firing in DataGrid

    Rick Strahl [MVP], Nov 21, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    5,909
    rohit.shrivastava04@gmail
    Aug 11, 2009
  2. Will McKee
    Replies:
    0
    Views:
    2,333
    Will McKee
    Feb 23, 2004
  3. steve
    Replies:
    0
    Views:
    191
    steve
    Dec 16, 2003
  4. Will McKee
    Replies:
    8
    Views:
    181
    sharath GT
    Oct 9, 2004
  5. Marc Woolfson

    DataGrid.PageIndexChanged not firing on when 0th page requested

    Marc Woolfson, May 23, 2007, in forum: ASP .Net Datagrid Control
    Replies:
    4
    Views:
    935
    Scott M.
    May 25, 2007
Loading...

Share This Page