paging, fetching data again

2 posts, 0 answers
  1. James Shelton-Agar
    James Shelton-Agar avatar
    108 posts
    Member since:
    May 2008

    Posted 24 Jun 2010 Link to this post

    When the RadlistView page changed, it tend to call NeedDatasource and reload data, but when i say .datasouce = something; .databind(); when page change, it still go for needdatasource and try to reload data.
    Is there anyway that the radlistview/grid not going round the trip and fetching data again? 

    following code working but will fetch data again
     <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
                <telerik:AjaxSetting AjaxControlID="AListingsGrid"
                        <telerik:AjaxUpdatedControl ControlID="AListingsGrid" /> 
        <telerik:RadListView ID="AListingsGrid" runat="server" AllowPaging="True" ItemPlaceholderID="PropertiesContianer" 
                <fieldset id="RadListView1"
                    <telerik:RadDataPager ID="RadDataPager2" PageSize="1" runat="server" Style="border: none;" 
                            <telerik:RadDataPagerButtonField FieldType="Numeric" /> 
                    <asp:PlaceHolder ID="PropertiesContianer" runat="server" /> 
                    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> 

      Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load 
            If Not Me.IsPostBack Then 
            End If 
        End Sub 
        Private Sub RadListView1_ItemDataBound(ByVal sender As ObjectByVal e As Telerik.Web.UI.RadListViewItemEventArgs) Handles AListingsGrid.ItemDataBound 
            If (TypeOf (e.Item) Is RadListViewDataItem) Then 
                Dim dataBoundItem = DirectCast(e.Item, RadListViewDataItem) 
                Dim astr = DirectCast(dataBoundItem.DataItem, String
                DirectCast(dataBoundItem.FindControl("Label1"), Label).Text = astr 
            End If 
        End Sub 
        Private Sub AListingsGrid_NeedDataSource(ByVal sender As ObjectByVal e As Telerik.Web.UI.RadListViewNeedDataSourceEventArgs) Handles AListingsGrid.NeedDataSource 
            Dim alst As New List(Of String
            Dim i As Integer 
            For i = 0 To 10 
                alst.Add(String.Format("item {0}", i.ToString)) 
            AListingsGrid.DataSource = alst 
        End Sub 

  2. BaiH
    BaiH avatar
    83 posts
    Member since:
    Aug 2008

    Posted 25 Jun 2010 Link to this post

    No, the control needs the data for the next page, therefore you should supply it.

  3. DevCraft R3 2016 release webinar banner
Back to Top