Wednesday, 18 July 2018

Single checked inside gridview using jquery

///////////// JS


function SingleCheckInside_Table(th) {
                        var userType = $(th).closest('tr').find('td').eq(1).html();
                        var selectedIndex = $(th).closest('tr').index();
                        $('[id*=TableID] tr').each(function (index, item) {
                            if (index > 0) {
                                if (selectedIndex != index) {
                                    $('[id*=TableID] tr').eq(index).find('[id*=CheckboxID]').prop('checked', false);

                                }
                            }
                        });
                    }

////////////////////////////html

  <table><tr><td>


<asp:CheckBox runat="server" ID="Checkboxid" onclick="return SingleCheckInside_Table(this);" />


 </td></tr></table>


No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...