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 1108689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:07:25+00:00 2026-05-17T02:07:25+00:00

I want to implement a panel to set user permissions. So i have a

  • 0

I want to implement a panel to set user permissions. So i have a PermissionListView where the ItemSource is an ObservableCollection and in this PermissionListView I have a Checkbox for each Item which is bound to PermissionViewModel.Checked. I debugged it and this works.

The user gets selected in another ListView(UserListView). But I dont see a more MVVM like method to check the Permissions which are contained in UserListView.SelectedItem.Permissions, than simply use the OnSelectionChanged event to iterate over the ObservableCollection and set PermissionViewModel.Checked = true or false.

But since a change of the properties doesn’t fire the CollectionChanged event the panel still shows the selection of the last user.

  1. Is there any more MVVM like way to accomplish a ‘Check all PermissionViewModels that are also in UserListView.SelectedItem.Permissions’ ?

  2. If not, how can i cause a visible update in the Listview after setting the Checked properties of the list’s items?

  • 1 1 Answer
  • 3 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-05-17T02:07:26+00:00Added an answer on May 17, 2026 at 2:07 am

    I could use an example with actual users and permissions, so I’m going to go ahead and create one – please tell me if this doesn’t match what you’re trying to do.

    You have users and permissions like this (I’m using * for selected and Yes or – for checked):

    UserListView        PermissionsListView
    
    *Fred*              Read Yes
    Wilma               Write -
    Barney              Execute -
    Betty
    

    So the PermissionsListView is currently showing Fred’s permissions. It seems that you want to know how to change the list of permissions to show Barney’s permissions when Barney is selected.

    What you could do is bind the OnSelectionChanged to the model so that it updates the selected user, then provide the Permissions through another property.

    MyPermissionsListModel : INotifyPropertyChanged
    {
       Command OnSelectionChanged(User user) { 
           // Command which calls ChangeSelectedUser
       }
    
       private void ChangeSelectedUser(User user) {
           _user = user;
           PropertyChanged(this, new PropertyChangedEventArgs("Permissions");
       }
    
       public ObservableCollection<Permission> Permissions {
           return new ObservableCollection<Permission>(_user.Permissions);
       }
    }
    

    Then you use a data template or a grid view to show the checked or unchecked permissions. I presume whether they’re checked or unchecked is part of the permissions here, otherwise wrap the permissions and checked / unchecked state in a little ViewModel of their own. If they’re not on the user then go get them from wherever they’re from.

    Please feel free to ask anything I haven’t understood; it’s hard to work out exactly what you’re doing without a picture!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this System.Windows.Forms.Panel that I want to enable so that if the user
i starter in jqgrid, i want implement inline edit in jqgrid i have this
I want to implement an application which will work as a parser. User will
I want to implement a panning pictureBox in C# winforms. I have a panel
In many cases I have the same panel which edits a set of properties
I need add paging to panel, which populated with dynamically-created controls. I want implement
I want to implement video panel in android in which i want to create
given this class definition: public class Frame { IFrameStream CapturedFrom; } I want implement
I want to implement a list of ViewPagers. Every item of a ListView is
I am developing an asp.net application in which I want to implement the discussion

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.