Datagrid PageIndexChanged event not firing

V

Vijay

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';");
}
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top