Ramco Ramco

Ramco Ramco

  • 442
  • 3.4k
  • 523.5k

Gridview Data

Jul 11 2022 11:59 AM

Hi

Is the below thing can be done thru c# code. I will not be using any Button or LinkButon click.

<script type="text/javascript">
    $(document).ready(function () {
        $(".gv > tbody > tr:not(:has(table, th))")
            .css("cursor", "pointer")
            .click(function (e) {
                $(".gv td").removeClass("highlite");
                var $cell = $(e.target).closest("td");
                $cell.addClass('highlite');
                var $currentCellText = $cell.text();
                var $colIndex = $cell.parent().children().index($cell);
                var $colName = $cell.closest("table")
                    .find('th:eq(' + $colIndex + ')').text();
            });
    });
</script>