Archive

Posts Tagged ‘Binding’

WPF coding mutually exclusive Check Boxes with Data Binding

January 23rd, 2011 2 comments

Last week I was coding a View that required for me to show two ChekBox controls which were mutually exclusive in the same way that two or more RadioButton controls that belong to the same group would interact.

My problem was that one Boolean property which came from a bit column in the database needed to drive which CheckBox would be checked: “Yes” or “No”.

In this example I attempt to show how to code two mutually exclusive checkboxes while binding to the Boolean property described above:

image

The Name of the Property in the Code Behind file that we are going to bind to is AddInsurance.

Here is the XAML code:

Read more…

Categories: C#, Programming, WPF Tags: , ,