Nov 06, 2009, 11:27 AM
RadiobuttonGroup
Hi all !
I cannot clear a radiobuttongroup.checkeditems:
After the line radButtons.CheckedItems.Clear(); CheckedItems.Count is still > 0
I have to set unchecked all buttons manually:
radButton0.Checked = false;
radButton1.Checked = false;
radButton2.Checked = false;
Another related question: How can I easily check the right button in a group? Is there any automatic way? I know buttongroup has a Value property but I'm not sure it's what I want, I wish I could set buttongroup value and then the right button get checked and the rest cleared in that group.
Here is my code:
I cannot clear a radiobuttongroup.checkeditems:
After the line radButtons.CheckedItems.Clear(); CheckedItems.Count is still > 0
I have to set unchecked all buttons manually:
radButton0.Checked = false;
radButton1.Checked = false;
radButton2.Checked = false;
Another related question: How can I easily check the right button in a group? Is there any automatic way? I know buttongroup has a Value property but I'm not sure it's what I want, I wish I could set buttongroup value and then the right button get checked and the rest cleared in that group.
Here is my code:
radGeziDurumu.CheckedItems.Clear();
try
{
switch (Convert.ToInt16(query.Result.Rows[0]["geziDurumu"]))
{
case 0: radGeziDurumu0.Checked = true; break;
case 1: radGeziDurumu1.Checked = true; break;
case 2: radGeziDurumu2.Checked = true; break;
}
}
catch { radGeziDurumu0.Checked = true; }
P.S: code wrapping is buggy?