In order to use a RequiredFieldValidator with a CheckBoxList, you need to define your own CheckBoxList class that inherits from CheckBoxList , but also implements a
ValidationPropertyAttribute method:
[ValidationPropertyAttribute("ValidateableProperty")]
public class ValidateableCheckBoxList : CheckBoxList
{
public string ValidateableProperty
{
get
{
string result = "";
int count = 0;
foreach (ListItem item in this.Items)
{
if (item.Selected)
{
count++;
}
}
if (count > 0)
{
result = count.ToString();
}
else
{
result = "";
}
return result;
}
}
}
You can then create a
ValidateableCheckBoxList and point a required validator's controlToValidate attribute to it.
SOURCE:
http://pedroliska.wordpress.com/2009/08/13/getting-an-asp-net-checkboxlist-to-work-with-a-requiredfieldvalidator/