Select all the child items by selecting parent items in Gridview using JQuery

Hi, 
Here am coding to select all the records with same value by selecting its parent element. To select in such a manner I have bonded same value of the parent and its child. While selecting the Parent element by the value, all the child items associated with that value will be selected automatically. As output and Code shown below

output preview :
ASPX CODE:
<html>
<head runat="server">
<title>Copyright @Fourthbottle</title>
<script src="Scripts/jquery-2.1.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
        function HideCheckBoxText() {
            $('input[type="checkbox"]').each(function () {
                var selectedID = $(this).attr('id');
                var value = $('label[for=' + selectedID + ']').css("display", "none");
            });
        }
function Selectallcheckbox(val) {
            if (!$(this).is(':checked')) {
                $('input:checkbox').prop('checked', val.checked);
            } else {
                $("#chkroot").removeAttr('checked');
            }
        }
function SelectallColorsForStyle(e, eval) {
            if (e.checked) {
                $(":checkbox[value=" + eval + "]").prop("checked", e.checked);

                if (!$('input.checkboxselection[type=checkbox]:not(:checked)').length)
                    $("#CHK_STY_ALL").prop("checked", true);

                if (!$('input.chk_clr_ind[type=checkbox]:not(:checked)').length)
                    $("#chk_clr_sel_all").prop("checked", true);
            }
            else {
                $(":checkbox[value=" + eval + "]").attr('checked', false);
                $("#CHK_STY_ALL").attr("checked", false);
                $("#chk_clr_sel_all").attr("checked", false);
            }
        }
   
function SelectallColorcheckbox(e) {
            if (e.checked) {
                $(".chk_clr_ind").prop("checked", true)
            }
            else {
                $(".chk_clr_ind").prop("checked", false)
            }
        }
function UnselectSelectAllColor(e) {
            if (!e.checked) {
                $("#chk_clr_sel_all").attr("checked", false);
            }
            else {
                if (!$('input.chk_clr_ind[type=checkbox]:not(:checked)').length)
                    $("#chk_clr_sel_all").prop("checked", true);
            }
        }
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table width="100%">
<tr>
<td align="center">
<asp:GridView ID="grd" runat="server" AutoGenerateColumns="false" OnRowDataBound="grd_RowDataBound">
<Columns>

<asp:TemplateField ItemStyle-HorizontalAlign="Center" >
<HeaderTemplate>SELECT ALL<br />
<asp:CheckBox ID="CHK_STY_ALL"  runat="server" ClientIDMode="Static" onclick="javascript:Selectallcheckbox(this);" />
</HeaderTemplate>
<ItemTemplate>
<input type="checkbox"  id="CHK_STY" runat="server" onchange="javascript:SelectallColorsForStyle(this,this.value);" class="checkboxselection" value='<%#Eval("Brand")%>' />
</ItemTemplate>
</asp:TemplateField>

<asp:BoundField HeaderText="BRAND" ItemStyle-Width="90px" DataField="Brand" />

<asp:TemplateField ItemStyle-HorizontalAlign="Center" >
<HeaderTemplate>SELECT ALL<br />
<asp:CheckBox ClientIDMode="Static" ID="chk_clr_sel_all" runat="server" onclick="javascript:SelectallColorcheckbox(this);">
</asp:CheckBox>
</HeaderTemplate>
<ItemTemplate>
<input type="checkbox" id="CHK_CLR" runat="server" class="chk_clr_ind" onchange="javascript:UnselectSelectAllColor(this);" value='<%#Eval("Brand")%>' />
</ItemTemplate>
</asp:TemplateField>

<asp:BoundField HeaderText="MODEL" ItemStyle-Width="90px" DataField="Model" />
<asp:BoundField HeaderText="TYPE" ItemStyle-Width="90px" DataField="Type" />
<asp:BoundField HeaderText="PRICE" ItemStyle-Width="90px" DataField="Price" />
</Columns>
</asp:GridView>
</td>
</tr>
</table>
<asp:Label ID="lblstatus" ClientIDMode="Static" runat="server"></asp:Label>
</div>
</form>
</body>
</html>



C# CODE:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

namespace GRD_Merge_Paging
{
    public partial class GRD_Check : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection("connection string");
            string Query = "select top 12 * from Table1 order by Brand desc";
            SqlDataAdapter da = new SqlDataAdapter(Query, con);
            DataSet DS = new DataSet();
            try
            {
                con.Open();
                da.Fill(DS);
                grd.DataSource = DS;
                grd.DataBind();
                con.Close();
            }
            catch (Exception es)
            {
                lblstatus.Text = es.Message.ToString();
            }
        }
        protected void grd_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            int RowSpan = 2;
            for (int i = grd.Rows.Count - 2; i >= 0; i--)
            {
                GridViewRow currRow = grd.Rows[i];
                GridViewRow prevRow = grd.Rows[i + 1];
                if (currRow.Cells[1].Text == prevRow.Cells[1].Text)
                {
                    currRow.Cells[1].RowSpan = RowSpan;
                    prevRow.Cells[1].Visible = false;
                    currRow.Cells[0].RowSpan = RowSpan;
                    prevRow.Cells[0].Visible = false;
                    RowSpan += 1;
                }
                else
                {
                    RowSpan = 2;
                }
            }
        }
    }
}