Q:

Can I use databinding formatting events to conditionally check checkboxes?

The info on formatting data bound controls here Is there a non-klunky way to perform special-case formatting with bound data? is great.
Now what if I want to conditionally check checkboxes - is there a way to use the formatting event to accomplish that? Currently my code is:
// if gender = "N" Index = -1, if "F", index = 0, if "M" index = 1;
if (platypusInfo.Gender.Equals("F")) {
    radioButtonFemale.Checked = true;
    radioButtonMale.Checked = false;
} else if (platypusInfo.Gender.Equals("M")) {
    radioButtonMale.Checked = true;
    radioButtonFemale.Checked = false;
} else { // (platypus.Gender == "N")
    radioButtonFemale.Checked = false;
    radioButtonMale.Checked = false;
}

A:

Along with the Binding.Format event, there is also a Binding.Parse event that you can use to reverse the information.
Each radio button would need its own databinding setup:
Binding maleBind = new Binding("Checked", person, "Gender", true);
maleBind.Format += new ConvertEventHandler(maleBind_Format);
maleBind.Parse += new ConvertEventHandler(maleBind_Parse);
radioButtonMale.DataBindings.Add(maleBind);

Binding femaleBind = new Binding("Checked", person, "Gender", true);
femaleBind.Format += new ConvertEventHandler(femaleBind_Format);
femaleBind.Parse += new ConvertEventHandler(femaleBind_Parse);
radioButtonFemale.DataBindings.Add(femaleBind);

and then the events:
void femaleBind_Parse(object sender, ConvertEventArgs e) {
  if ((bool)e.Value)
    e.Value = "F";
}

void femaleBind_Format(object sender, ConvertEventArgs e) {
  e.Value = ((string)e.Value == "F");
}

void maleBind_Parse(object sender, ConvertEventArgs e) {
  if ((bool)e.Value)
    e.Value = "M";
}

void maleBind_Format(object sender, ConvertEventArgs e) {
  e.Value = ((string)e.Value == "M");
}

