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
PhotoUploadLayoutTemplate:
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
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