<asp:TemplateField HeaderText="Default">
<ItemTemplate>
<asp:CheckBox id="cbdefault" runat="server" Checked='<%#Eval("Default") %>' onclick="check(this)" />
</ItemTemplate>
</asp:TemplateField>
script
<script language="javascript" type="text/javascript">
function check(source) {
var isChecked = source.checked;
var ids = {
grid: "<%= gvdetails.ClientID %>"
}
$("#" + ids.grid + " input[id*='cbdefault']").each(function (index) {
$(this).attr('checked', false);
});
source.checked = isChecked;
}
</script>
<ItemTemplate>
<asp:CheckBox id="cbdefault" runat="server" Checked='<%#Eval("Default") %>' onclick="check(this)" />
</ItemTemplate>
</asp:TemplateField>
script
<script language="javascript" type="text/javascript">
function check(source) {
var isChecked = source.checked;
var ids = {
grid: "<%= gvdetails.ClientID %>"
}
$("#" + ids.grid + " input[id*='cbdefault']").each(function (index) {
$(this).attr('checked', false);
});
source.checked = isChecked;
}
</script>
No comments:
Post a Comment