public class BBCheckBoxString : System.Windows.Forms.CheckBox { protected Binding oBinding = null; public virtual void DataBind(System.Data.DataTable Data, string Column) { this.Checked = false; this.oBinding = new Binding("Checked", Data, Column); this.oBinding.Format += new ConvertEventHandler(this.FormatHandler); this.oBinding.Parse += new ConvertEventHandler(this.ParseHandler); this.DataBindings.Add(this.oBinding); } protected override void FormatHandler(object sender, ConvertEventArgs e) { if (e.Value.ToString() == "Y") e.Value = true; else e.Value = false; } protected override void ParseHandler(object sender, ConvertEventArgs e) { if ((bool)e.Value == true) e.Value = "Y"; else e.Value = "N"; } }Then, on your Form or control, to databind that Checkbox, you’d do this:
this.MyCheckBox.DataBind(MyTable, "MyYNColumn");~~Bonnie