Wednesday, April 26, 2017
Allow One CheckBox only in GRIDVIEW
Allow One CheckBox only in GRIDVIEW
Allow Once CheckBox only in GRIDVIEW
--allow one checkbox only in GRIDVIEW
<script type="text/javascript" lang="javascript">
function CheckOne(obj) {
var grid = obj.parentNode.parentNode.parentNode;
var inputs = grid.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == "checkbox") {
if (obj.checked && inputs[i] != obj && inputs[i].checked) {
inputs[i].checked = false;
}
}
}
}
</script>
--inside your gridview
<asp:TemplateField HeaderText="Pilih">
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" onclick="CheckOne(this)" />
</ItemTemplate>
</asp:TemplateField>
Android, Galaxy Note, Galaxy S, N7000, I9000, Jelly Bean, ICS, Ice Cream Sandwich, Gingerbread, 4.2, 4.1.2, 4.3, 4.4, GNote, XDA, Flash, ROM, Sammobile, DarkyROM, Semaphore, GingerReal, CyanogenMod, Android, Google, Eclair, Froyo, Gingerbread, Ice Cream Sandwich, Jelly Bean, Kit Kat, Galaxy S
Available link for download