简体   繁体   中英

how do we highlight a row in the gridview on selection of a dropdown in the same? using javascript/Jquery?

On row data bound, the gridview is being populated, and how do we higlight one particular row after a dropdown is selected in that same row. [C# .net]

Find the dropdown ID and add class. Finding ID in server control may be vary in different case.

 $("[id*=GridViewID] td select").change(function () {
            $("td", $(this).closest("tr")).addClass("HighLightRow");
});

CSS:

.HighLightRow
 {
     background-color: #A1DCF2;
 }

Note : Don't forget to include JQuery Library.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM