DataPager is blocked when removing item from QueryableDataServiceCollectionView

11 posts, 0 answers
  1. Sasa
    Sasa avatar
    25 posts
    Member since:
    Jul 2013

    Posted 21 Jul 2015 Link to this post

    I have GridView and DataPager, both have source of QueryableDataServiceCollectionView:

    var ctx = new MyContext();
     
    var query = (DataServiceQuery<ArtiklSifarnik>)ctx.ArtiklSifarnik.OrderBy(x => x.Sifra);
     
    var view = new QueryableDataServiceCollectionView<ArtiklSifarnik>(ctx, query);
                 
    view.PropertyChanged += OnPropertyChanged;
    view.LoadedData += OnLoadedData;
     
    view.PageSize = 100;
    view.AutoLoad = true;
     
    gridView.ItemsSource = view;
    pager.Source = view;

     

    On selecting grid row and removing one item on button click GridView is refreshed but my DataPager is blocked:

    view.Remove(gridView.SelectedItem as ArtiklSifarnik);

     

    What am I missing?

    Thanks

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 22 Jul 2015 Link to this post

    Hello,

    I tested the reported scenario locally and as it turns out once I remove an item from RadGridView, the pager becomes as ReadOnly and no navigation is possible any more. Do you mean this as blocked? 

    Regards,
    Dimitrina
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
  4. Sasa
    Sasa avatar
    25 posts
    Member since:
    Jul 2013

    Posted 23 Jul 2015 in reply to Dimitrina Link to this post

    Hi Dimitrina,

    yes,​ that is what I thought.

  5. Sasa
    Sasa avatar
    25 posts
    Member since:
    Jul 2013

    Posted 24 Jul 2015 Link to this post

    Do you have any solution for that problem?

    Thanks

  6. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 24 Jul 2015 Link to this post

    Hi,

    Would you try submitting the changes (i.e. the deleted item)? Does RadDataPager become usable?

    Regards,
    Dimitrina
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  7. Sasa
    Sasa avatar
    25 posts
    Member since:
    Jul 2013

    Posted 28 Jul 2015 in reply to Dimitrina Link to this post

    Hi Dimitrina,

    If I try submitting the changes like this:

    view.Remove(gridView.SelectedItem as ArtiklSifarnik);
    view.SubmitChanges();

    I get an unhandled exception (you can see in the attachment).

    Thanks

  8. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 28 Jul 2015 Link to this post

    Hello,

    I am sorry to hear that. I performed some more tests and as it turns out I got a similar error. Even after replacing RadDataPager with the Silverlight DataPager, the behavior was the same. This should mean there is not an issue with RadDataPager specifically.

    After debugging with the source codes directly, the inner exception shows as a reason: Forbidden. The full message is:
    <?xml version="1.0" encoding="utf-8"?><m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><m:code /><m:message xml:lang="en-US">Forbidden</m:message></m:error>

    How have you configured loading your data? In my case, I defined it like so:
    public MyNorthwindContext() : base(new Uri("http://services.odata.org/Northwind/Northwind.svc", UriKind.Absolute)) { }

    Does the service itself allow modifications?

    Regards,
    Dimitrina
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  9. Sasa
    Sasa avatar
    25 posts
    Member since:
    Jul 2013

    Posted 28 Jul 2015 in reply to Dimitrina Link to this post

    Hi,

    my context code:

    public class MyContext : EFATICWareDb2014_18032014Entities
        {
            public MyContext() : base(new Uri("WcfDataService1.svc", UriKind.Relative)) { }
        }

    and my service:

    public class WcfDataService1 : DataService<EFATICWareDb2014_18032014Entities>
        {
            // This method is called only once to initialize service-wide policies.
            public static void InitializeService(DataServiceConfiguration config)
            {
                // TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.
                // Examples:
                config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
                config.SetServiceOperationAccessRule("*", ServiceOperationRights.AllRead);
                config.SetServiceActionAccessRule("*", ServiceActionRights.Invoke);
                
     
                config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
            }
        }

    and yes, it allow modifications.

    Thanks

  10. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 29 Jul 2015 Link to this post

    Hello,

    Would it be possible for you to isolate the issue in a demo project and send it to us in a new support ticket? You can also take a look at this blog post for a reference on how to isolate an issue. 

    Regards,
    Dimitrina
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  11. Sasa
    Sasa avatar
    25 posts
    Member since:
    Jul 2013

    Posted 29 Jul 2015 in reply to Dimitrina Link to this post

    Hi Dimitrina,

    my subscription expired and I can't open new support ticket but I have nothing else in this project, only this code I sent you and two controls, grid and pager, and entity data model.

    Thanks

  12. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 30 Jul 2015 Link to this post

    Hello,

    My observations are that RadDataPager as well as MS DataPager becomes invisible since there are changes on the view (you can check this through view.HasChanges). Would you please try configuring your view so that changes can be committed or canceled and there are no pending changes any more? In case there are no changes on the view anymore and the control is still disabled while MS DataPager works fine, then I will need a demo project to debug it further. 

    Regards,
    Dimitrina
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner