i have a checkbox(chkBoxMgr) on a windows form that i have already linked to a bindingsource(staffBindingSource).
the value on the Staff table for the Mananger field is a "Y" how do i get the chkBoxMgr checkbox in a CHECKED state seeing that the value of the Manager field on the Staff table is a "Y" ????
staffData is my Dataset.
my code:
Binding b = new Binding("Checked", staffData, "Retail"); //staffData is my dataset but gives error
b.Format += new ConvertEventHandler(MyFormat); //get error
b.Parse += MyParse(); //get error
ChkBoxRetail.DataBindings.Add(b); //get error
private void MyFormat(Object sender, ConvertEventArgs e)
{
if ((String)e.Value == "Y")
{
e.Value = true;
}
else
{
e.Value = false;
}
}
public void MyParse(Object sender, ConvertEventArgs e)
{
if ((bool)e.Value == true)
{
e.Value = "Y";
}
else
{
e.Value = "N";
}
}
can any one help me with the first 4 lines it is not correct
thanks
helloise