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"
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="AListingsGrid"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="AListingsGrid" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadListView ID="AListingsGrid" runat="server" AllowPaging="True" ItemPlaceholderID="PropertiesContianer" 
            PageSize="1"
            <LayoutTemplate> 
                <fieldset id="RadListView1"
                    <telerik:RadDataPager ID="RadDataPager2" PageSize="1" runat="server" Style="border: none;" 
                        PagedControlID="AListingsGrid"
                        <Fields> 
                            <telerik:RadDataPagerButtonField FieldType="Numeric" /> 
                        </Fields> 
                    </telerik:RadDataPager> 
                    <asp:PlaceHolder ID="PropertiesContianer" runat="server" /> 
                </fieldset> 
            </LayoutTemplate> 
            <ItemTemplate> 
                <div> 
                    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> 
                </div> 
            </ItemTemplate> 
        </telerik:RadListView> 

      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)) 
            Next 
            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.

    --BH
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top