Solved

Bind Checkboxes in DataGrid

Posted on 2011-03-01
3
606 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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is about my first experience with programming Arduino.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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…

772 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

10 Experts available now in Live!

Get 1:1 Help Now