Question

I hav a gridview inside a usercontrol

 <asp:GridView ID="grdMissingFilterData" runat="server"   AllowPaging="True" Width="100%"
                        AllowSorting="True" AutoGenerateColumns="False" GridLines="None"
                        PageSize="30" OnPageIndexChanging="grdMissingFilterData_PageIndexChanging">
                        <Columns>
                            <asp:BoundField DataField="Varenummer" HeaderText="Varenummer"   ItemStyle-Width="25%" >
                            <ItemStyle Width="25%" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Varenavn" HeaderText="Varenavn"  ItemStyle-Width="15%" >
                            <ItemStyle Width="15%" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Producentvarenummer" HeaderText="Producent varenummer"  ItemStyle-Width="15%" >
                            <ItemStyle Width="15%" />
                            </asp:BoundField>
                        </Columns>
                        <AlternatingRowStyle CssClass="altrow" />
                        <PagerSettings FirstPageText="First" LastPageText="Last" PageButtonCount="50" />
                        <EmptyDataTemplate>
                            There is no data available to display!
                        </EmptyDataTemplate>
   <PagerStyle CssClass="pager" />
    </asp:GridView>

and code in postback

if (!Page.IsPostBack)
    {  
        BindData(); 
    }

then i had a PageIndexChanging event which never fires when i click on paging.

 protected void grdMissingFilterData_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
    grdMissingFilterData.PageIndex = e.NewPageIndex;
    BindData();
}

can any one give me any possible reasons?

Was it helpful?

Solution

This may be probably an issue with your user control not about gridview. Focus on that part

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top