Unable to Set RadDataPager current index exists in RadListView using Javascript

2 posts, 0 answers
  1. Phani
    Phani avatar
    10 posts
    Member since:
    Mar 2015

    Posted 24 Aug 2015 Link to this post

    Dear Team,

     

    I'm using RadDataPager inside a ListView. I need to reset the current page index to 1 in one specific scenario using javascript.

     

    I'm using the below javascript code to reset the grid. but it is unable to find the DataPager Control. Please help on achieving the required functionality. 

    var gridImages = $find("#<%=RadDataPagerLibraryVideos.ClientID %>");
    gridImages.set_currentPageIndex(1);

     

    ListView:

     
    <telerik:RadListView CssClass="thumbnail" AllowPaging="true" ItemPlaceholderID="VideosHolder" runat="server" ID="LibraryVideoListView" DataKeyNames="AssetID" OnNeedDataSource="LibraryVideoListView_NeedDataSource" OnItemDataBound="LibraryVideoListView_ItemDataBound">
                              <LayoutTemplate>
                                         <fieldset id="LibraryVideoListView">
                                      <telerik:RadDataPager ID="RadDataPagerLibraryVideos" runat="server" PagedControlID="LibraryVideoListView"
                                          PageSize="15" OnPageIndexChanged="RadDataPagerLibraryVideos_PageIndexChanged">
                                          <Fields>
                                              <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                                              <telerik:RadDataPagerButtonField FieldType="Numeric" />
                                              <telerik:RadDataPagerButtonField FieldType="NextLast" />
                                              <telerik:RadDataPagerPageSizeField PageSizeText="Page size: " />
                                              <telerik:RadDataPagerGoToPageField CurrentPageText="Page: " TotalPageText="of" SubmitButtonText="Go"
                                                  TextBoxWidth="15" />
                                              <telerik:RadDataPagerTemplatePageField>
                                                  <PagerTemplate>
                                                      <div style="float: right">
                                                          <b>Items
                                                                  <asp:Label runat="server" ID="CurrentPageLabel" Text="<%# Container.Owner.StartRowIndex+1%>" />
                                                              to
                                                                  <asp:Label runat="server" ID="TotalPagesLabel" Text="<%# Container.Owner.StartRowIndex+Container.Owner.PageSize %>" />
                                                              of
                                                                  <asp:Label runat="server" ID="TotalItemsLabel" Text="<%# Container.Owner.TotalRowCount%>" />
                                                              <br />
                                                          </b>
                                                      </div>
                                                  </PagerTemplate>
                                              </telerik:RadDataPagerTemplatePageField>
                                          </Fields>
                                      </telerik:RadDataPager>
                                  </fieldset>
                                  <div class="horizontal-list center-block">
                                      <asp:Panel ID="VideosHolder" runat="server" />
                                  </div>
                              </LayoutTemplate>
                              <ItemTemplate>
                                  <div class="imgLibraryItem">
                                      <a href="#" class="videoSelected thumbnail has-hover" assetid='<%# Eval("AssetID") %>'>
                                          <asp:Image runat="server" ID="imgVideoThumbnail" CssClass="libraryImg" />
                                      </a>
                                  </div>
                              </ItemTemplate>
                          </telerik:RadListView>

     

    Thanks in Advance,

    Phani

  2. Eyup
    Admin
    Eyup avatar
    3014 posts

    Posted 24 Aug 2015 Link to this post

    Hi Phani,

    You can use the fireCommand method provided by the RadListView to achieve this requirement:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/listview/client-side-programming/radlistview/methods/firecommand

    Hope this helps. Please give it a try and let me know if it works for you.

    Regards,
    Eyup
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top