Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8685853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:40:57+00:00 2026-06-12T22:40:57+00:00

While I was developing a startscreen for my app using the GridView control, I

  • 0

While I was developing a startscreen for my app using the GridView control, I run into a problem. I have a GridView on my main screen which has a CollectionViewSource set as ItemSource.

For this CollectionViewSource the source is set to an ObservableCollection list. Each GroupViewModel has a ObservableCollection in it. In code the important parts looks like the following:

public class StartPageViewModel : ViewModelBase
{
    public ObservableCollection<GroupViewModel> Groups { get; set; }
    public CollectionViewSource GroupsCvs { get; set; }     

    public StartPageViewModel()
    {
        // fill Groups with some mock data
        GroupsCvs.Source = Groups;
        GroupsCvs.IsSourceGrouped = true;
    }

    public void MoveItems(GroupViewModel grp)
    {
        // add a dummy item
        grp.AddRecipe(new ItemViewModel(new Item()) { Id = "123" });
        RaisePropertyChanged("GroupsCvs");
        RaisePropertyChanged("Groups");
    }
}

public class GroupViewModel : ViewModelBase, IEnumerable<ItemViewModel>
{ 
    public ObservableCollection<ItemViewModel> Items { get; set; }
}


View:

public sealed partial class MainPage : LayoutAwarePage
{
    private ViewModelLocator locator = new ViewModelLocator();

    public MainPage()
    {
        this.InitializeComponent();
        this.DataContext = locator.Main; // returns StartPageViewModel
    }
}

XAML part for MainPage, GridView

<GridView ItemsSource="{Binding GroupsCvs.View}" ...
</GridView>

How is it possible to get the UI refreshed when I add an Item to a Group’s collection? In my StartPageViewModel I’m adding dummy item to the GroupViewModel and I raise propertychanged, but the Grid remains the same.

I’ve also tried to fire property changed event in the GroupViewModel class, when the Items collection changes without any luck.

Edit: As I wrote in comments it’s possible to refresh with reassigning the source property however this gets the GridView rendered again which is not nice. I’m looking to options which would result in a nicer user experience.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:40:58+00:00Added an answer on June 12, 2026 at 10:40 pm

    I suppose CollectionViewSource doesn’t react to PropertyChanged event. Try reassigning Source to GroupCvs after you modify it. It’s not elegant but it should work:

    GroupsCvs.Source = Groups;
    

    As a last resort you could create a new instance of ObservableCollection<GroupViewModel> before reassigning it:

    Groups = new ObservableCollection<GroupViewModel>(Groups)
    GroupsCvs.Source = Groups;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While developing an app in HTML and jQuery, I have a loading screen that
While developing a design using jQuery I stumbled across a problem. How would I
I'm using Aptana as my IDE while developing a Symfony (1.4) site. I have
while developing a live wallpaper and testing on a HTC Desire HD, which has
While developing a web app using ZF, I had an haha! moment regarding the
While developing a test case to understand serialization, I've run into what looks like
While developing a game I have designed a class that in normal operation has
While developing a mobile PhoneGap app I had an interesting problem. I needed to
While developing a small 2D engine, I stumbled across a little design problem which
I just ran into a problem while developing a login system. I build a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.