This is quite complex as you need to use the first element as check all checkbox hence you need to use jQuery
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
var first = $("table:[id$=CheckBoxList1] input").eq(0);
first.bind("click", function () {
if ($(this).is(":checked")) {
$("input", $(this).closest("table:[id$=CheckBoxList1]")).not(this).attr("checked", "checked");
} else {
$("input", $(this).closest("table:[id$=CheckBoxList1]")).not(this).removeAttr("checked"); ;
}
});
$("table:[id$=CheckBoxList1] input").not(first).bind("click", function () {
if ($("table:[id$=CheckBoxList1] input:checked").not(first).length == $("table:[id$=CheckBoxList1] input").not(first).length) {
first.attr("checked", "checked");
} else {
first.removeAttr("checked"); ;
}
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:CheckBoxList ID="CheckBoxList1" runat="server">
<asp:ListItem Text="All" Value="0"></asp:ListItem>
<asp:ListItem Text="India" Value="1"></asp:ListItem>
<asp:ListItem Text="Australia" Value="2"></asp:ListItem>
<asp:ListItem Text="USA" Value="3"></asp:ListItem>
</asp:CheckBoxList>
</form>
</body>
</html>