This is a migrated thread and some comments may be shown as answers.

database view and refreshing data

1 Answer 88 Views
DomainDataSource
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
David Ocasio asked on 14 Jun 2012, 05:34 PM
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

1 Answer, 1 is accepted

Sort by
0
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 14 Jun 2012, 06:37 PM
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

Tags
DomainDataSource
Asked by
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
Answers by
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
Share this question
or