Problem with RadListView & RadDataPager

2 posts, 0 answers
  1. Ramin
    Ramin avatar
    9 posts
    Member since:
    Mar 2012

    Posted 27 Dec 2012 Link to this post

    I am creating a webpart that has a radlistview on it.  It uses a webservice (actually a generic handler because I cant figure out how to make a webservice actually return proper json and not xml) to get its data.  That works perfectly.  I have now added a raddatapager into my layouttemplate and I know that it is sort of working because if i change the pagesize member in the raddatapager, it does change the amount of records that come back.  The only problem: none of the buttons are showing up in my datapager.

    Here is a snippet of code:

    Main code to build the RadListView
    private void BuildResultPanel()
            {
                _mppUserListView = new Telerik.Web.UI.RadListView()
                                      {
                                          ID = "MPPUserResultList",
                                          RegisterWithScriptManager = true,
                                          AllowPaging = true
                                      };
                var mainDiv = new HtmlGenericControl("Div");
                mainDiv.Attributes.Add("style", "overflow:hidden;border:1px solid black;padding:5px;margin-top:15px");
                this.Controls.Add(mainDiv);
                mainDiv.Controls.Add(_mppUserListView);
                _mppUserListView.LayoutTemplate = new PhotoUploadLayoutTemplate();
                var photoUploadResultItemTemplate = new PhotoUploadResultItemTemplate();
                var container = new Control();
                photoUploadResultItemTemplate.InstantiateIn(container);
                var s = RenderControl(container);
                //_mppUserListView.ItemTemplate = photoUploadResultItemTemplate;
                //_mppUserListView.ItemPlaceholderID = "items";
                _mppUserListView.ClientSettings.DataBinding.ItemTemplate = s;
                _mppUserListView.ClientSettings.DataBinding.ItemPlaceHolderID = "items";
                _mppUserListView.ClientSettings.DataBinding.DataService.Location = "/_layouts/services/MPPusersPhotoBioUpload/MPPUsers.ashx";
                _mppUserListView.ClientSettings.DataBinding.DataService.DataPath = "GetMPPUsers";
                if (MIAjax != null) MIAjax.AjaxSettings.AddAjaxSetting(_mppUserListView, _mppUserListView, MIAjaxLoader);
            }

    PhotoUploadLayoutTemplate:
    public void InstantiateIn(Control container)
            {
                var dataPager = new RadDataPager { PagedControlID = "MPPUserResultList",
                    ID = "MPPUserResultList_pagerTop", PageSize = 20 };
                dataPager.Fields.Add(new RadDataPagerButtonField() { FieldType = PagerButtonFieldType.FirstPrev });
                dataPager.Fields.Add(new RadDataPagerButtonField() { FieldType = PagerButtonFieldType.Numeric, PageButtonCount = 5 });
                dataPager.Fields.Add(new RadDataPagerButtonField() { FieldType = PagerButtonFieldType.NextLast });
                container.Controls.Add(dataPager);
    ...
    }

    The raddatapager does render and shows a nice rectangle.. BUT NO BUTTONS!! :(

    Please let me know what I am doing wrong.  I have the ajaxmanager on the page, the radscriptmanager.  And it would appear I have it right since the ajax call is being made and the result list is showing the first 10 or 20 records (depending on my pagesize).  I just want to know why the buttons are not showing up.  And its not a CSS thing because I can see in the HTML that they arent rendering at all.

    Thanks
    Loren
  2. Kostadin
    Admin
    Kostadin avatar
    1711 posts

    Posted 02 Jan 2013 Link to this post

    Hi Loren,

    I am afraid the provided information is not enough to reproduce the issue. Could you please open a formal support ticket and provide us with a small runnable project? This way we could observe the issue locally and give you more to the point solution.

    Regards,
    Kostadin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top