DataGrid

G

Guest

I implemented paging on this grid
OnPageIndexChanged="dgSales_Page"

When i click Next page, it is firing OnItemCommand insted of
OnPageIndexChanged ???

<asp:datagrid id="dgSales" runat="server" Width="100%"
AutoGenerateColumns="False" HeaderStyle-CssClass="datagridheader"
PagerStyle-Visible="False" DataKeyField="referralID" AllowSorting="True"
OnSortCommand="SortSales"
OnItemCommand="detailsClicked" CssClass="datagrid"
OnItemDataBound="DGSales_ItemDatabound"
PageSize="2" AllowPaging="True" OnPageIndexChanged="dgSales_Page" >
 
S

Scott Mitchell [MVP]

vinay said:
I implemented paging on this grid
OnPageIndexChanged="dgSales_Page"

When i click Next page, it is firing OnItemCommand insted of
OnPageIndexChanged ???

Are you sure it's not firing *both* ItemCommand and PageIndexChanged?
When any command button in the DataGrid is clicked - be it a paging
button, a sorting hyperlink button, a ButtonColumn button, etc. - the
DataGrid's ItemCommand event fires.

--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!
 

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

Top