Solved

Bind Checkboxes in DataGrid

Posted on 2011-03-01
3
609 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

785 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