开发者

Add row to gridview on client side

开发者 https://www.devze.com 2022-12-17 10:43 出处:网络
I have asp.net\'s .aspx page. that have GridView let say GridViewParent and Each row have the another GridView as GridViewChild. Now Gri开发者_运维知识库dViewChild have button AddRow and another contr

I have asp.net's .aspx page. that have GridView let say GridViewParent and Each row have the another GridView as GridViewChild. Now Gri开发者_运维知识库dViewChild have button AddRow and another controls like DropDownControl,RadioButtons..etc... I want after click the button AddRow there must add row on client side. How can i do same. Please guide me .... Send me code


<script type="text/javascript" src="../../js/jquery-1.3.2.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
    $('#<%=cmdAdd.ClientID %>').bind('click', function(event) {
        //debugger;
        event.preventDefault();
        var $grid = $('#<%=ctlGrid.ClientID %> ');
        var $row = $grid.find('tr:last').clone().appendTo($grid);
        $row.find('select')[0].selectedIndex = 0;
        $row.find('input').each(function() {
            $(this).val("");
        });
        return true;
    });
});

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号