Hello, here is my code:
<asp:DataGrid ID="DG_Installments" runat="server" AllowPaging="true" ShowPager="true"
PageSize="10" AllowSorting="False" DataKeyField="DUEDATE"
EnableViewState="true"
OnItemDataBound="DG_Installments_ItemDataBound"
OnItemCommand="DG_Installments_ItemCommand"
OnPageIndexChanged="DG_Installments_PageIndexChanged">
...
some template columns
...
As mentioned, this is in my ascx file. Now I set a breakpoint to stop at the DG_Installments_PageIndexChanged method, which looks like that:
protected void DG_Installments_PageIndexChanged(object sender, DataGridPageChangedEventArgs e)
{
//do Something
}
Thing is, its not stopping there when I click one of the pagers. I am binding the datasource in the Page_Load of the ascx. This looks like that:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Bind();
}
}
And finally the Bind() method looks like that:
private void Bind()
{
DG_Installments.DataSource = Installments;
DG_Installments.DataBind();
}
The Installments property is a generic list which I build on my own. The pagers are shown, but the grids counter at the bottom always show no hits... it looks like that: 1--1 of -1 matches (not sure if thats the correct translation, I only have a german version :)).
This ascx is placed in a normal aspx.
Anyone can help?