This is a migrated thread and some comments may be shown as answers.

RadDataPager Server Event not firing

6 Answers 102 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 13 Jun 2011, 05:43 PM
Hi,

I've been knocking my head against this problem for a full day now - any help will be very much appreciated.

I have a databound RadPanelBar, each Panel contains a set of search results. The display of results is encapsulated in a user controls, SearchResults. The user control is instantiated in the item template of the panel bar, and on databinding, it's event delegates are set - yest these are never called when the datapager posts back from the client.

The markup looks like this:

<telerik:RadPanelBar ID="resultsPanelBar" runat="server" ExpandMode="FullExpandedItem" >
    <ItemTemplate>                         
        <telerik:RadAjaxPanel ID="wrapperPanel" runat="server" RequestQueueSize="10">               
            <telerik:RadXmlHttpPanel RequestQueueSize="4" LoadingPanelID="searchLoadingPanel" ID="resultsUpdatePanel" runat="server">           
                <selfsvc:SearchResults ID="searchResult" runat="server" />
            </telerik:RadXmlHttpPanel>
        </telerik:RadAjaxPanel>
    </ItemTemplate>
</telerik:RadPanelBar>

The databinding code sets the delegates for the pager's server events as follows:

void resultsPanelBar_ItemDataBound(object sender, Telerik.Web.UI.RadPanelBarEventArgs e)
{
    string sourceName = ((KeyValuePair<string, string>)e.Item.DataItem).Key;
    RadXmlHttpPanel panel = (RadXmlHttpPanel)e.Item.FindControl("resultsUpdatePanel");
    if (panel != null)
    {
        selfService.UserControls.SearchResults results = (selfService.UserControls.SearchResults)panel.FindControl("searchResult");
        if (results != null)
        {
            results.SourceName = sourceName;
            RadDataPager pager = (RadDataPager)results.FindControl("RadDataPager1");
            if (pager != null)
            {
                pager.Command += new EventHandler<RadDataPagerCommandEventArgs>(pager_Command);
                pager.PageIndexChanged += new EventHandler<RadDataPagerPageIndexChangeEventArgs>(pager_PageIndexChanged);
            
        }
        clientPnlSrcMap.Add(panel.ClientID, sourceName);
        panel.ServiceRequest += new XmlHttpPanelEventHandler(panel_ServiceRequest);
    }

6 Answers, 1 is accepted

Sort by
0
Accepted
Maria Ilieva
Telerik team
answered on 16 Jun 2011, 12:11 PM
Hello Rob,

Please note that you should not use wrapped RadAjaxPanel and RadXmlHttpPanel. Also you have placed server control into the RadXmlHttpPanel which is not correct and will not work properly. I would suggest you to remove the RadXmlHttpPanel and use only RadAjaxPanel to ajaxify the needed content. Give this a try and let me know if ti makes any difference. Also please refer to the following online help topic which elaborates on what the RadXmlHttpPanel exactly is and in which case it should be used.


Kind regards,
Maria Ilieva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Accepted
Maria Ilieva
Telerik team
answered on 16 Jun 2011, 12:11 PM
Hello Rob,

Please note that you should not use wrapped RadAjaxPanel and RadXmlHttpPanel. Also you have placed server control into the RadXmlHttpPanel which is not correct and will not work properly. I would suggest you to remove the RadXmlHttpPanel and use only RadAjaxPanel to ajaxify the needed content. Give this a try and let me know if ti makes any difference. Also please refer to the following online help topic which elaborates on what the RadXmlHttpPanel exactly is and in which case it should be used.


Kind regards,
Maria Ilieva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Rob
Top achievements
Rank 1
answered on 16 Jun 2011, 12:35 PM
Thanks Maria, I have re-worked my solution.

I had however, been trying to achieve the functionality described in this demo:

http://demos.telerik.com/aspnet-ajax/xmlhttppanel/examples/gridinxmlhttppanel/defaultcs.aspx

Is this scenario no longer supported? I could have saved a great deal of time had I known.

0
Rob
Top achievements
Rank 1
answered on 20 Jun 2011, 04:11 PM
Hi,

Thanks again for your assistance. Could you answer my question in this post regarding: http://demos.telerik.com/aspnet-ajax/xmlhttppanel/examples/gridinxmlhttppanel/defaultcs.aspx

Thanks,
Rob.
0
Maria Ilieva
Telerik team
answered on 21 Jun 2011, 01:07 PM
Hi Rob,

The mentioned demo actually presents a scenario in which you could use the RadXmlHttpPanel with server controls and in order to have the server events of those controls works correctly RadAjaxPanel I also added. However note that this could not be applicable in all cases and for all server controls. i already discuss this implementation with my colleagues responsive for the RadXmlHttpPanel demos and we decide to remove this one from our site in order to avoid confusing our customers.
Thank you for bringing this to our attention.

Kind regards,
Maria Ilieva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Rob
Top achievements
Rank 1
answered on 21 Jun 2011, 02:04 PM
HI Maria,

Thank you very much for clearing that up for me.

Rob.
Tags
DataPager
Asked by
Rob
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Rob
Top achievements
Rank 1
Share this question
or