You often need to retrieve the gridview cell content and you write the long code in your code behind.
Below mentioned script are used to retrieve the cell content of gridview on click.
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$("#<%=GridView.ClientID%> tr").filter(":not(:has(table, th))").click(function(e)
{
var $cell = $(e.target).closest("td"); $("#<%=GridView1.ClientID%> td"). removeClass("highlight"); $cell.addClass("highlight"); $("#message").text('You have selected: ' + $cell. text());
});
});
</script>
Post By : Dipen Shah
Blog By : Dipen Shah
Stay Connected...
Below mentioned script are used to retrieve the cell content of gridview on click.
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$("#<%=GridView.ClientID%> tr").filter(":not(:has(table, th))").click(function(e)
{
var $cell = $(e.target).closest("td"); $("#<%=GridView1.ClientID%> td"). removeClass("highlight"); $cell.addClass("highlight"); $("#message").text('You have selected: ' + $cell. text());
});
});
</script>
Post By : Dipen Shah
Blog By : Dipen Shah
Stay Connected...