<script type="text/javascript" language="javascript">
function checkAllBoxes(grid, num)
{
var totalChkBoxes = parseInt(num);
var gvControl = document.getElementById(grid);
var gvChkBoxControl = "chkBoxChild";
var mainChkBox = document.getElementById("chkBoxAll");
var inputTypes = gvControl.getElementsByTagName("input");
for(var i = 0; i < inputTypes.length; i++)
{
if(inputTypes[i].type == 'checkbox' && inputTypes[i].id.indexOf(gvChkBoxControl,0) >= 0)
inputTypes[i].checked = mainChkBox.checked;
}
}
</script>
<asp:GridView ID="grdDR" runat="server">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<input id="chkBoxAll" type="checkbox"
onclick="checkAllBoxes('<%= grdDR.ClientID %>', '<%= grdDR.Rows.Count %>')" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkBoxChild" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Trns ID" HeaderText="Trns ID" >
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
</asp:BoundField>
<asp:BoundField DataField="User" HeaderText="User" >
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
</asp:BoundField>
<asp:BoundField DataField="Deposit Amount" HeaderText="Deposit Amount" >
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
</asp:BoundField>
No comments:
Post a Comment