Monday, 2 June 2014

Add CSS in gridview cells using jquery in asp.net

//HTML -GridView

 <asp:GridView ID="GridView1" runat="server" >
        </asp:GridView>

//Jquery-

<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>

 <script type="text/javascript" language="javascript">

    $(document).ready(function () {
        $(function () {
            $('#<%=GridView1.ClientID%> td').toggle(function () {
                $(this).css('background', '#93BD00');

            },
                function () {
                    $(this).css('background', 'white', 'cursor', 'pointer', 'padding', '2px');
                });
        });
 </script>

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...