database view and refreshing data

2 posts, 0 answers
  1. David Ocasio
    David Ocasio avatar
    147 posts
    Member since:
    Nov 2009

    Posted 14 Jun 2012 Link to this post

    I am using your raddatasource to support the paging of data in a radgridview.

    The query executing via the ria domainservice is actually a database view.

    <telerik:RadDomainDataSource QueryName="GetVBinMaster_ALLStock_Ordered" x:Name="ddsStock" AutoLoad="True" PageSize="500" >
        <telerik:RadDomainDataSource.DomainContext>
            <Stock:InventoryDomainContext x:Name="Inventory" />
        </telerik:RadDomainDataSource.DomainContext>
    </telerik:RadDomainDataSource>


    The problem is that if the data in the view changes on the server (not through the client) ,
    the changes are not reflected in the gridview when i call the load method of the datasource(via a button)

    i have tried changing the loadbehavior in  the loadingdata event of the datasource to no avail

    I do have somehting that works
    if i actually clear the underlying domaincontext  when a page is returned
    but i am worried that it will eventually cause undesired effects.

    Private Sub btnRefreshStock_Click(sender As Object, e As System.Windows.RoutedEventArgs) Handles btnRefreshStock.Click
        RefreshData()
    End Sub
     
    Private Sub ddsStock_LoadingData(sender As Object, e As Telerik.Windows.Controls.DomainServices.LoadingDataEventArgs) Handles ddsStock.LoadingData
        '        StockListGridView.IsBusy = True
        e.LoadBehavior = LoadBehavior.RefreshCurrent
        TraceWindow.Trace("Start --> load Stock data")
        TraceWindow.Trace(CType(ddsStock.DomainContext, InocartRIAServicesLibrary.Web.Stock.InventoryDomainContext).vBinMaster_ALLStocks.Count)
    End Sub
     
    Private Sub ddsStock_LoadedData(sender As Object, e As Telerik.Windows.Controls.DomainServices.LoadedDataEventArgs) Handles ddsStock.LoadedData
        '       StockListGridView.IsBusy = False
        TraceWindow.Trace(CType(ddsStock.DomainContext, InocartRIAServicesLibrary.Web.Stock.InventoryDomainContext).vBinMaster_ALLStocks.Count)
        TraceWindow.Trace("Finished --> load Stock data")
        CType(ddsStock.DomainContext, InocartRIAServicesLibrary.Web.Stock.InventoryDomainContext).vBinMaster_ALLStocks.Clear()
    End Sub

    any assistance as to a better method
    would be appreciated

    thanks
    dco
  2. David Ocasio
    David Ocasio avatar
    147 posts
    Member since:
    Nov 2009

    Posted 14 Jun 2012 Link to this post

    i may have posted this too soon
    the refreshcurrent seems to be working

    i will revise this post if that proves to be wrong

    sorry for my quick post
    dco

  3. DevCraft banner
Back to Top