[CLOSED] Switching DataSource of GridPanel store causing problems with paging

  1. #1

    [CLOSED] Switching DataSource of GridPanel store causing problems with paging

    I'm using remote paging/sorting. All of that is working well, but occasionally, I need to change the datasource that the store is reading from. If I've changed my page to something >1 then it's possible that I can get the situation where my current page is greater than the total number of pages. What I need to do is reset the paging start value when the datasource is changed. Here's part of the code that I'm using:

    I'm trying to switch the datasource on my grid using something like the following. The actual changing of the datasource is working fine. I just need to put something in the DataBind so that the page number is set back to 1. How can I do this?

        Public Overrides Sub DataBind()
            'Clear out grid and reset paging
        End Sub
        Public Sub Store_Refresh(ByVal sender As Object, ByVal e As Ext.Net.StoreRefreshDataEventArgs)
            Dim stuff As New List(Of Object)
            For i = 1 To 1000
                stuff.Add(New With {.foo = "Row " & i})
            e.Total = stuff.Count
            'Handle sorting
            stuff = stuff.Skip(e.Start).Take(e.Limit)
            Store1.DataSource = stuff
        End Sub
    Last edited by geoffrey.mcgill; Jul 24, 2010 at 4:43 AM.
  2. #2

Similar Threads

  1. GridPanel, Store, DataSource - passing Keys
    By alexua in forum 2.x Help
    Replies: 0
    Last Post: Jul 16, 2012, 8:10 PM
  2. GridPanel, Store and switching datasources
    By HansWapenaar in forum 1.x Help
    Replies: 1
    Last Post: Jun 04, 2012, 8:48 PM
  3. [CLOSED] Change Store Datasource in Combo Editor Column inside GridPanel
    By tlfdesarrollo in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Apr 13, 2012, 7:32 PM
  4. Replies: 5
    Last Post: Feb 01, 2012, 11:54 AM
  5. [CLOSED] ComboBox / Store / DataSource : Store.DataSource is NULL
    By wagger in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Apr 24, 2011, 10:09 AM

Posting Permissions