Hi all,
i have a question about checkbox.
i made a form, with some textboxes, and buttons..
the idea is this..
i want to enter some information (like name, address..) and some hobbies !
i made the hobbies as a checkboxes.. so the user check the ones apply..
then i made a "SAVE" button, to add this whole info to a arraylist,
i put a "back" and "next" buttons to navigate records..
it worked perfectly for the names and addresses ! (when i click back, it
shows the previous data object with its info)
but, the problem is.. i cant retrieve the checkbox condition !
i used this code to stor data :
private ArrayList GetHobbies()
{
if (mCheckBoxWalking.Checked)
Hobbies.Add("Walking");
if (mCheckBoxSwimming.Checked)
Hobbies.Add("Swimming");
if (mCheckBoxReading.Checked)
Hobbies.Add("Reading");
return Hobbies;
}
and i tried to retrive the use information by this code :
void GetUser(UserInformation user)
{
mTextboxName.Text = user.Name; // to get the name
mTextboxAddress.Text = user.Address; // to get the adderss
if (user.Hobbies.ToString() == "Walking")
mCheckBoxWalking.Checked = true;
if (user.Hobbies.ToString() == "Swimming")
mCheckBoxSwimming.Checked = true;
if (user.Hobbies.ToString() == "Reading")
mCheckBoxReading.Checked = true;
}
as i said, the name and address worked.
but the checkbox is not !
plz some help here ! :)
and thanx in advance..
--
Eng. Rushd R. Momani