DataGrid

  • Thread starter Thread starter Guest
  • Start date Start date
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" >
 
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!
 
Back
Top