Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
320
WHDG Custom Paging issue
posted

I've been attempting to implement a custom paging control for my WHDG using the following two sources:

http://community.infragistics.com/aspnet/articles/learn-to-build-a-webdatagrid-custom-pager.aspx

http://samples.infragistics.com/2010.2/WebFeatureBrowser/contents.aspx?showCode=true&t=WebDataGrid/Paging/WebDataGrid_AdvCustomPager.aspx~srcview.aspx?path=~srcview.aspx?path=WebDataGrid/Paging/WebDataGrid_AdvCustomPager.src

But with both i run into the same issue, I am unable to obtain a reference to the paging control.

I place the ascx user control into page by dropping it in the designer, then move the code to the behavior section of the WHDG

                                <Behaviors>
                                    <ig:Paging PageSize="100">
                                        <PagerTemplate>
                                            <uc1:CustomPager ID="CustomPager" runat="server" />
                                        </PagerTemplate>
                                    </ig:Paging>
                                </Behaviors>

Then try to get a reference to the object with:

this._customPager = this.Report_Grid.Behaviors.Paging.PagerTemplateContainer.FindControl("CustomPager") as CustomPager;

I've tried in multiple places to get a reference, WHDG init, page_load, Page_init, etc. ReWrote the code about 3 times, tripple checked my control names, tried PagerTemplateContainerBottom, PagerTemplateContainerTop, PagerTemplateContainer.

No matter what i try the findcontrol always returns null.