forum

home / developersection / forums / linkbutton to expand gridview causes row colors from function to be lost

linkbutton to expand gridview causes row colors from function to be lost

Anonymous User 1731 23-Aug-2014

When a Link button I have in my gridview that expands the table to show a nested gridview i lose all the row colors that i get from this function. What I need is a way to call the function when the link button is clicked.

 <script type="text/javascript"> 
     $(document).ready(function () {
            $("#<%=GridView1.UniqueID%> tr").each(function () {
                var status = $(this).children('td:eq(6)').text();
                if (status == 'OK') {
                    $(this).children('td').css({ "background-color": "lightgreen" });   
                }
                else if (status == 'XL') {
                $(this).children('td').css({ "background-color": "RED" });
            }
               else if (status == 'CL') {
                $(this).children('td').css({ "background-color": "YELLOW" });
            }
            })
        });
</script>

Updated on 23-Aug-2014

I am a content writter !


Message
Can you answer this question?

Answer

1 Answers

Liked By