Solved

Bind Checkboxes in DataGrid

Posted on 2011-03-01
3
608 Views
Last Modified: 2012-05-11
We are developing an application in WPF using MVVMLight. We are working on creating a form where multiple Roles can be assigned to a user. The roles are displayed in a grid having checkboxes so that user can select roles from Grid. During user editing, the existing roles should come preselected in the grid. We do not have any property which can be bound to checkboxes in Grid. We are not sure how to implement this. Please suggest some idea to implement the above functionality.
0
Comment
Question by:dineshwins
3 Comments
 
LVL 12

Accepted Solution

by:
kumar754 earned 500 total points
ID: 35021947
there are multiple ways you can implement. if you have

you can extend your current class that you are binding to the Grid

public partial class <MyClass>
{
  // I am leving this empty here, but your shld use RaisePropertyChanged("IsAdmin"); in Set
  public bool IsAdmin { get; set; }
  public bool IsSuperUser { get; set; }
  public bool IsManager { get; set; }
  public bool IsUser { get; set; }

}

and then you can bind the class collection to the grid,

just before you save.. implement your save method to handle this properties.
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 35321647
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Runtime Exceptions when trying to submit data 28 37
What .NET URL re-routing tool did I use? 2 38
how to read json value 2 32
Not seen Link button 5 19
A short article about problems I had with the new location API and permissions in Marshmallow
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now