This question is locked. New answers and comments are not allowed.
Hi there,
I am having a strange behavior with calling QDSCV from code behind. I will try and explaing the scenario using the order/customer analogy with the exception that the orders can be customer-less.
I have a RadWindow, OrderView, where I can edit an order, thereby setting, changing and removing the assigned customer. When the user wants to assign a customer, they click a button and a RadWindow, CustomerView is started.
CustomerView has the following markup
In CodeBehind I am instantiating the QDSCV as follows:
In order to assure the "fresh" data is loaded, I subscribe to LoadingData and set LoadBehavior
All works fine except for the following scenario:
- In OrderView I unassign a customer from the order. The Entity customer is then removed from the order.
- I try to assign another custome to the order and start CustomerView. No call to the server is made. Fiddler shows no network activity. - CustomerDataSourceLoadingData is not hit when the customer has been unassigned from the order. It is only hit if no operations have been conducted.
I would really appreciate your help on this. Doing data-retrival the "Telerik-Way" was promising to be great until I hit this issue!!!
Greetings
I am having a strange behavior with calling QDSCV from code behind. I will try and explaing the scenario using the order/customer analogy with the exception that the orders can be customer-less.
I have a RadWindow, OrderView, where I can edit an order, thereby setting, changing and removing the assigned customer. When the user wants to assign a customer, they click a button and a RadWindow, CustomerView is started.
CustomerView has the following markup
<Controls:RadGridView x:Name="CustomerGrid" SelectionMode="Extended" SelectedItem="{Binding Path=Current, Mode=TwoWay}" AutoGenerateColumns="False" ShowColumnHeaders="True" ShowGroupPanel="False" CanUserDeleteRows="False" CanUserFreezeColumns="False" CanUserInsertRows="False" CanUserReorderColumns="True" CanUserResizeColumns="True" BorderBrush="Black" IsFilteringAllowed="False" FontSize="16" RowHeight="28" HorizontalGridLinesBrush="#A6000000" RowDetailsVisibilityMode="VisibleWhenSelected" RowIndicatorVisibility="Collapsed" VerticalGridLinesBrush="#A6000000" Margin="4" TabNavigation="Cycle" Height="420" />
In CodeBehind I am instantiating the QDSCV as follows:
var itemsSource = new QueryableDomainServiceCollectionView<KundeEntity>(SimpleServiceLocator.Instance.Get<IBasisBauemeModel>().Context, SimpleServiceLocator.Instance.Get<IBasisBauemeModel>().Context.GetKundenQuery());itemsSource.LoadingData += KundeDataSourceLoadingData;itemsSource.AutoLoad = true;itemsSource.PageSize = 10;KundeGrid.ItemsSource = itemsSource;KundePager.Source = itemsSource;itemsSource.Load(true);In order to assure the "fresh" data is loaded, I subscribe to LoadingData and set LoadBehavior
private void CustomerDataSourceLoadingData(object sender, Telerik.Windows.Controls.DomainServices.LoadingDataEventArgs e){ e.LoadBehavior = LoadBehavior.RefreshCurrent;}All works fine except for the following scenario:
- In OrderView I unassign a customer from the order. The Entity customer is then removed from the order.
- I try to assign another custome to the order and start CustomerView. No call to the server is made. Fiddler shows no network activity. - CustomerDataSourceLoadingData is not hit when the customer has been unassigned from the order. It is only hit if no operations have been conducted.
I would really appreciate your help on this. Doing data-retrival the "Telerik-Way" was promising to be great until I hit this issue!!!
Greetings