How to disable checkbox inside gridview in jquery?
<p>Hi I am developing one asp.net application with the help of jquery. I have one gridview in my application. It has got checkboxes for each row. Along with checkbox i am binding some values to hidden fields.
This is my gridview code.</p>

<pre><code>&lt;asp:TemplateField&gt;
            &lt;ItemTemplate&gt;
                &lt;asp:CheckBox ID="chkRow" runat="server" /&gt;
                &lt;asp:HiddenField ID="Hidden" runat="server" Value='&lt;%#Eval("Name")%&gt;' /&gt;
            &lt;/ItemTemplate&gt;
&lt;/asp:TemplateField&gt;
&lt;asp:BoundField DataField="Name" HeaderText="Name" ItemStyle-Width="150" /&gt;
</code></pre>

<p>Above code renders output as for example</p>

<pre><code>           Name
   chkbox  Andy
   chkbox  Marry
   chkbox  Daniel
</code></pre>

<p>I am binding same Name(used in Boundfield) to hiddenfield also. I have one dropdown with multiselect feature. Whenever i select Andy from dropdown then i want to disable the Andy checkbox in gridview. I am trying as below. I am getting dropdownselected value in first array and all the hidden value fields in second array. I am pushing common elements to third array.
This is my code.</p>

<pre><code> var result = new Array();
            for (var i = 0; i &lt; ResultArrayFirst.length; i++) {
                if (selected.indexOf(ResultArrayFirst[i]) &gt;= 0) {
                    result.push(ResultArrayFirst[i]);
                }
            }
</code></pre>

<p>For example, result array will contain values such as Andy,Marry. In this case i want to disable the checkbox from grid which is left to Andy and Mary. I tried my level best and could not fix it. Any help would be appreciated. Thanks a lt.</p>

<p>I tried as below.</p>

<pre><code>for (var k = 0; k &lt; result.length; k++)
            {
                $('#&lt;%= GridView1.ClientID %&gt; input[type="hidden"]').each(function () {

                    if($(this).val()==result[k])
                    {

                       //Not sure how to hide disable checkbox GridView1.rows[i].cells[0].getElementsByTagName("INPUT")[0].checked = true;
                    }
                });
                break;
            }
</code></pre>

<p>this is not working still. Need any help on this</p>